//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_HeartPulse{ public const string TAB_FILE_DATA = "HeartPulse"; private const int _varCount = 18; 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_HeartPulse() { } public Tab_HeartPulse(string line) { var segments = line.Split('\t'); Id = int.Parse(segments[0]); Level = int.Parse(segments[2]); NeedAttrId[0] = int.Parse(segments[3]); NeedAttrId[1] = int.Parse(segments[5]); NeedAttrId[2] = int.Parse(segments[7]); NeedAttrId[3] = int.Parse(segments[9]); NeedAttrId[4] = int.Parse(segments[11]); NeedAttrValue[0] = int.Parse(segments[4]); NeedAttrValue[1] = int.Parse(segments[6]); NeedAttrValue[2] = int.Parse(segments[8]); NeedAttrValue[3] = int.Parse(segments[10]); NeedAttrValue[4] = int.Parse(segments[12]); AttrId[0] = int.Parse(segments[13]); AttrId[1] = int.Parse(segments[15]); AttrId[2] = int.Parse(segments[17]); AttrValue[0] = int.Parse(segments[14]); AttrValue[1] = int.Parse(segments[16]); AttrValue[2] = int.Parse(segments[18]); } public int Id { get; private set; } public int Level { get; private set; } public readonly int[] NeedAttrId = new int[5]; public int getNeedAttrIdCount() { return NeedAttrId.Length; } public int GetNeedAttrIdbyIndex(int idx) { if(idx >= 0 && idx < NeedAttrId.Length) return NeedAttrId[idx]; return default(int); } public readonly int[] NeedAttrValue = new int[5]; public int getNeedAttrValueCount() { return NeedAttrValue.Length; } public int GetNeedAttrValuebyIndex(int idx) { if(idx >= 0 && idx < NeedAttrValue.Length) return NeedAttrValue[idx]; return default(int); } public readonly int[] AttrId = new int[3]; public int getAttrIdCount() { return AttrId.Length; } public int GetAttrIdbyIndex(int idx) { if(idx >= 0 && idx < AttrId.Length) return AttrId[idx]; return default(int); } public readonly int[] AttrValue = new int[3]; public int getAttrValueCount() { return AttrValue.Length; } public int GetAttrValuebyIndex(int idx) { if(idx >= 0 && idx < AttrValue.Length) return AttrValue[idx]; return default(int); } } }