2024-08-23 15:49:34 +08:00

106 lines
2.7 KiB
C#

//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_GemProp{
public const string TAB_FILE_DATA = "GemProp";
private const int _varCount = 19;
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_GemProp()
{
}
public Tab_GemProp(string line)
{
var segments = line.Split('\t');
Id = int.Parse(segments[0]);
GemID = int.Parse(segments[2]);
PartType = int.Parse(segments[3]);
NewPartType = segments[4].Trim();
GemLevel = int.Parse(segments[5]);
PropID[0] = int.Parse(segments[6]);
PropID[1] = int.Parse(segments[9]);
PropID[2] = int.Parse(segments[12]);
PropID[3] = int.Parse(segments[15]);
PropSubID[0] = int.Parse(segments[7]);
PropSubID[1] = int.Parse(segments[10]);
PropSubID[2] = int.Parse(segments[13]);
PropSubID[3] = int.Parse(segments[16]);
PropValue[0] = int.Parse(segments[8]);
PropValue[1] = int.Parse(segments[11]);
PropValue[2] = int.Parse(segments[14]);
PropValue[3] = int.Parse(segments[17]);
SkillID = int.Parse(segments[18]);
CombatValue = int.Parse(segments[19]);
}
public int Id { get; private set; }
public int GemID { get; private set; }
public int PartType { get; private set; }
public string NewPartType { get; private set; }
public int GemLevel { get; private set; }
public readonly int[] PropID = new int[4];
public int getPropIDCount() { return PropID.Length; }
public int GetPropIDbyIndex(int idx)
{
if(idx >= 0 && idx < PropID.Length)
return PropID[idx];
return default(int);
}
public readonly int[] PropSubID = new int[4];
public int getPropSubIDCount() { return PropSubID.Length; }
public int GetPropSubIDbyIndex(int idx)
{
if(idx >= 0 && idx < PropSubID.Length)
return PropSubID[idx];
return default(int);
}
public readonly int[] PropValue = new int[4];
public int getPropValueCount() { return PropValue.Length; }
public int GetPropValuebyIndex(int idx)
{
if(idx >= 0 && idx < PropValue.Length)
return PropValue[idx];
return default(int);
}
public int SkillID { get; private set; }
public int CombatValue { get; private set; }
}
}