77 lines
1.8 KiB
C#
77 lines
1.8 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_EquipFixedPropID{
|
||
|
|
||
|
public const string TAB_FILE_DATA = "EquipFixedPropID";
|
||
|
private const int _varCount = 11;
|
||
|
|
||
|
public int GetId()
|
||
|
{
|
||
|
return EquipID;
|
||
|
}
|
||
|
|
||
|
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_EquipFixedPropID()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public Tab_EquipFixedPropID(string line)
|
||
|
{
|
||
|
var segments = line.Split('\t');
|
||
|
EquipID = int.Parse(segments[0]);
|
||
|
PropID[0] = int.Parse(segments[2]);
|
||
|
PropID[1] = int.Parse(segments[4]);
|
||
|
PropID[2] = int.Parse(segments[6]);
|
||
|
PropID[3] = int.Parse(segments[8]);
|
||
|
PropID[4] = int.Parse(segments[10]);
|
||
|
PropSubID[0] = int.Parse(segments[3]);
|
||
|
PropSubID[1] = int.Parse(segments[5]);
|
||
|
PropSubID[2] = int.Parse(segments[7]);
|
||
|
PropSubID[3] = int.Parse(segments[9]);
|
||
|
PropSubID[4] = int.Parse(segments[11]);
|
||
|
|
||
|
}
|
||
|
|
||
|
public int EquipID { get; private set; }
|
||
|
|
||
|
public readonly int[] PropID = new int[5];
|
||
|
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[5];
|
||
|
public int getPropSubIDCount() { return PropSubID.Length; }
|
||
|
public int GetPropSubIDbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < PropSubID.Length)
|
||
|
return PropSubID[idx];
|
||
|
return default(int);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|