87 lines
2.3 KiB
C#
87 lines
2.3 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_Relation{
|
||
|
|
||
|
public const string TAB_FILE_DATA = "Relation";
|
||
|
private const int _varCount = 30;
|
||
|
|
||
|
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_Relation()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public Tab_Relation(string line)
|
||
|
{
|
||
|
var segments = line.Split('\t');
|
||
|
Id = int.Parse(segments[0]);
|
||
|
Relation[0] = int.Parse(segments[2]);
|
||
|
Relation[1] = int.Parse(segments[3]);
|
||
|
Relation[2] = int.Parse(segments[4]);
|
||
|
Relation[3] = int.Parse(segments[5]);
|
||
|
Relation[4] = int.Parse(segments[6]);
|
||
|
Relation[5] = int.Parse(segments[7]);
|
||
|
Relation[6] = int.Parse(segments[8]);
|
||
|
Relation[7] = int.Parse(segments[9]);
|
||
|
Relation[8] = int.Parse(segments[10]);
|
||
|
Relation[9] = int.Parse(segments[11]);
|
||
|
Relation[10] = int.Parse(segments[12]);
|
||
|
Relation[11] = int.Parse(segments[13]);
|
||
|
Relation[12] = int.Parse(segments[14]);
|
||
|
Relation[13] = int.Parse(segments[15]);
|
||
|
Relation[14] = int.Parse(segments[16]);
|
||
|
Relation[15] = int.Parse(segments[17]);
|
||
|
Relation[16] = int.Parse(segments[18]);
|
||
|
Relation[17] = int.Parse(segments[19]);
|
||
|
Relation[18] = int.Parse(segments[20]);
|
||
|
Relation[19] = int.Parse(segments[21]);
|
||
|
Relation[20] = int.Parse(segments[22]);
|
||
|
Relation[21] = int.Parse(segments[23]);
|
||
|
Relation[22] = int.Parse(segments[24]);
|
||
|
Relation[23] = int.Parse(segments[25]);
|
||
|
Relation[24] = int.Parse(segments[26]);
|
||
|
Relation[25] = int.Parse(segments[27]);
|
||
|
Relation[26] = int.Parse(segments[28]);
|
||
|
Relation[27] = int.Parse(segments[29]);
|
||
|
Relation[28] = int.Parse(segments[30]);
|
||
|
|
||
|
}
|
||
|
|
||
|
public int Id { get; private set; }
|
||
|
|
||
|
public readonly int[] Relation = new int[29];
|
||
|
public int getRelationCount() { return Relation.Length; }
|
||
|
public int GetRelationbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < Relation.Length)
|
||
|
return Relation[idx];
|
||
|
return default(int);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|