81 lines
1.9 KiB
C#
81 lines
1.9 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_PrivilegeFunction{
|
|
|
|
public const string TAB_FILE_DATA = "PrivilegeFunction";
|
|
private const int _varCount = 20;
|
|
|
|
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_PrivilegeFunction()
|
|
{
|
|
}
|
|
|
|
public Tab_PrivilegeFunction(string line)
|
|
{
|
|
var segments = line.Split('\t');
|
|
Id = int.Parse(segments[0]);
|
|
PrivilegeVipType = int.Parse(segments[2]);
|
|
PrivilegeId = int.Parse(segments[3]);
|
|
Vip[0] = segments[4].Trim();
|
|
Vip[1] = segments[5].Trim();
|
|
Vip[2] = segments[6].Trim();
|
|
Vip[3] = segments[7].Trim();
|
|
Vip[4] = segments[8].Trim();
|
|
Vip[5] = segments[9].Trim();
|
|
Vip[6] = segments[10].Trim();
|
|
Vip[7] = segments[11].Trim();
|
|
Vip[8] = segments[12].Trim();
|
|
Vip[9] = segments[13].Trim();
|
|
Vip[10] = segments[14].Trim();
|
|
Vip[11] = segments[15].Trim();
|
|
Vip[12] = segments[16].Trim();
|
|
Vip[13] = segments[17].Trim();
|
|
Vip[14] = segments[18].Trim();
|
|
Vip[15] = segments[19].Trim();
|
|
Vip[16] = segments[20].Trim();
|
|
|
|
}
|
|
|
|
public int Id { get; private set; }
|
|
|
|
public int PrivilegeVipType { get; private set; }
|
|
|
|
public int PrivilegeId { get; private set; }
|
|
|
|
public readonly string[] Vip = new string[17];
|
|
public int getVipCount() { return Vip.Length; }
|
|
public string GetVipbyIndex(int idx)
|
|
{
|
|
if(idx >= 0 && idx < Vip.Length)
|
|
return Vip[idx];
|
|
return default(string);
|
|
}
|
|
|
|
|
|
}
|
|
} |