//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_CangKuUnlock{ public const string TAB_FILE_DATA = "CangKuUnlock"; private const int _varCount = 8; public int GetId() { return Index; } 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_CangKuUnlock() { } public Tab_CangKuUnlock(string line) { var segments = line.Split('\t'); Index = int.Parse(segments[0]); ConsumeSubType = int.Parse(segments[2]); ConsumeNum = int.Parse(segments[3]); CellNum = int.Parse(segments[4]); UnlockNum = int.Parse(segments[5]); VIPRestrict[0] = int.Parse(segments[6]); VIPRestrict[1] = int.Parse(segments[7]); VIPRestrict[2] = int.Parse(segments[8]); } public int Index { get; private set; } public int ConsumeSubType { get; private set; } public int ConsumeNum { get; private set; } public int CellNum { get; private set; } public int UnlockNum { get; private set; } public readonly int[] VIPRestrict = new int[3]; public int getVIPRestrictCount() { return VIPRestrict.Length; } public int GetVIPRestrictbyIndex(int idx) { if(idx >= 0 && idx < VIPRestrict.Length) return VIPRestrict[idx]; return default(int); } } }