//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_CharModel{ public const string TAB_FILE_DATA = "CharModel"; private const int _varCount = 16; 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_CharModel() { } public Tab_CharModel(string line) { var segments = line.Split('\t'); Id = int.Parse(segments[0]); Name = segments[2].Trim(); ResPath = segments[3].Trim(); EffectID = segments[4].Trim(); HeadPic = segments[5].Trim(); HeadInfoHeight = float.Parse(segments[6]); Scale = float.Parse(segments[7]); DeadSound[0] = short.Parse(segments[8]); DeadSound[1] = short.Parse(segments[9]); DeadSound[2] = short.Parse(segments[10]); ModelType = int.Parse(segments[11]); BodyPos = segments[12].Trim(); BodyRot = segments[13].Trim(); HalfPos = segments[14].Trim(); HalfRot = segments[15].Trim(); DieShadetime = float.Parse(segments[16]); } public int Id { get; private set; } public string Name { get; private set; } public string ResPath { get; private set; } public string EffectID { get; private set; } public string HeadPic { get; private set; } public float HeadInfoHeight { get; private set; } public float Scale { get; private set; } public readonly short[] DeadSound = new short[3]; public int getDeadSoundCount() { return DeadSound.Length; } public short GetDeadSoundbyIndex(int idx) { if(idx >= 0 && idx < DeadSound.Length) return DeadSound[idx]; return default(short); } public int ModelType { get; private set; } public string BodyPos { get; private set; } public string BodyRot { get; private set; } public string HalfPos { get; private set; } public string HalfRot { get; private set; } public float DieShadetime { get; private set; } } }