//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_InteractionNode{ public const string TAB_FILE_DATA = "InteractionNode"; private const int _varCount = 13; 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_InteractionNode() { } public Tab_InteractionNode(string line) { var segments = line.Split('\t'); Id = int.Parse(segments[0]); Title = segments[2].Trim(); RewDescStrdicId = int.Parse(segments[3]); InteractiveType = int.Parse(segments[4]); Param = segments[5].Trim(); Reward[0] = int.Parse(segments[6]); Reward[1] = int.Parse(segments[8]); Reward[2] = int.Parse(segments[10]); Reward[3] = int.Parse(segments[12]); Num[0] = int.Parse(segments[7]); Num[1] = int.Parse(segments[9]); Num[2] = int.Parse(segments[11]); Num[3] = int.Parse(segments[13]); } public int Id { get; private set; } public string Title { get; private set; } public int RewDescStrdicId { get; private set; } public int InteractiveType { get; private set; } public string Param { get; private set; } public readonly int[] Reward = new int[4]; public int getRewardCount() { return Reward.Length; } public int GetRewardbyIndex(int idx) { if(idx >= 0 && idx < Reward.Length) return Reward[idx]; return default(int); } public readonly int[] Num = new int[4]; public int getNumCount() { return Num.Length; } public int GetNumbyIndex(int idx) { if(idx >= 0 && idx < Num.Length) return Num[idx]; return default(int); } } }