Files
JJBB/Assets/Project/Script/GameTables/Table_CombatTip.cs

105 lines
2.9 KiB
C#
Raw Normal View History

2024-08-23 15:49:34 +08:00
//This code create by CodeEngine ,don't modify
using System;
using System.Collections.Generic;
using System.Collections;
using Module.Log;
namespace GCGame.Table
{
public class Tab_CombatTip{
public const string TAB_FILE_DATA = "CombatTip";
private const int _varCount = 39;
public int GetId()
{
return Id;
}
public static bool Validate(string line)
{
var segments = 0;
foreach (char c in line)
if (c == '\t')
segments++;
// Note: skip the 2nd column as it's the description;
var result = segments == _varCount;
if (!result)
LogModule.ErrorLog(string.Format("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", TAB_FILE_DATA, _varCount, segments));
return result;
}
public Tab_CombatTip()
{
}
public Tab_CombatTip(string line)
{
var segments = line.Split('\t');
Id = int.Parse(segments[0]);
TipValueA[0] = int.Parse(segments[2]);
TipValueA[1] = int.Parse(segments[4]);
TipValueA[2] = int.Parse(segments[6]);
TipValueA[3] = int.Parse(segments[8]);
TipValueA[4] = int.Parse(segments[10]);
TipValueA[5] = int.Parse(segments[12]);
TipValueA[6] = int.Parse(segments[14]);
TipValueA[7] = int.Parse(segments[16]);
TipValueA[8] = int.Parse(segments[18]);
TipValueA[9] = int.Parse(segments[20]);
TipValueA[10] = int.Parse(segments[22]);
TipValueA[11] = int.Parse(segments[24]);
TipValueA[12] = int.Parse(segments[26]);
TipValueA[13] = int.Parse(segments[28]);
TipValueA[14] = int.Parse(segments[30]);
TipValueA[15] = int.Parse(segments[32]);
TipValueA[16] = int.Parse(segments[34]);
TipValueA[17] = int.Parse(segments[36]);
TipValueA[18] = int.Parse(segments[38]);
TipValueB[0] = int.Parse(segments[3]);
TipValueB[1] = int.Parse(segments[5]);
TipValueB[2] = int.Parse(segments[7]);
TipValueB[3] = int.Parse(segments[9]);
TipValueB[4] = int.Parse(segments[11]);
TipValueB[5] = int.Parse(segments[13]);
TipValueB[6] = int.Parse(segments[15]);
TipValueB[7] = int.Parse(segments[17]);
TipValueB[8] = int.Parse(segments[19]);
TipValueB[9] = int.Parse(segments[21]);
TipValueB[10] = int.Parse(segments[23]);
TipValueB[11] = int.Parse(segments[25]);
TipValueB[12] = int.Parse(segments[27]);
TipValueB[13] = int.Parse(segments[29]);
TipValueB[14] = int.Parse(segments[31]);
TipValueB[15] = int.Parse(segments[33]);
TipValueB[16] = int.Parse(segments[35]);
TipValueB[17] = int.Parse(segments[37]);
TipValueB[18] = int.Parse(segments[39]);
}
public int Id { get; private set; }
public readonly int[] TipValueA = new int[19];
public int getTipValueACount() { return TipValueA.Length; }
public int GetTipValueAbyIndex(int idx)
{
if(idx >= 0 && idx < TipValueA.Length)
return TipValueA[idx];
return default(int);
}
public readonly int[] TipValueB = new int[19];
public int getTipValueBCount() { return TipValueB.Length; }
public int GetTipValueBbyIndex(int idx)
{
if(idx >= 0 && idx < TipValueB.Length)
return TipValueB[idx];
return default(int);
}
}
}