110 lines
2.8 KiB
C#
110 lines
2.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_TitleData{
|
||
|
|
||
|
public const string TAB_FILE_DATA = "TitleData";
|
||
|
private const int _varCount = 18;
|
||
|
|
||
|
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_TitleData()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public Tab_TitleData(string line)
|
||
|
{
|
||
|
var segments = line.Split('\t');
|
||
|
Id = int.Parse(segments[0]);
|
||
|
Type = int.Parse(segments[2]);
|
||
|
InvestitiveDescription = segments[3].Trim();
|
||
|
Name = segments[4].Trim();
|
||
|
NameImage = segments[5].Trim();
|
||
|
TitileClass = int.Parse(segments[6]);
|
||
|
TitleName = segments[7].Trim();
|
||
|
AttrDesc = segments[8].Trim();
|
||
|
GetDesc = segments[9].Trim();
|
||
|
ColorLevel = segments[10].Trim();
|
||
|
OwnerTime = int.Parse(segments[11]);
|
||
|
AttrId[0] = int.Parse(segments[12]);
|
||
|
AttrId[1] = int.Parse(segments[14]);
|
||
|
AttrVal[0] = int.Parse(segments[13]);
|
||
|
AttrVal[1] = int.Parse(segments[15]);
|
||
|
CombatPower = int.Parse(segments[16]);
|
||
|
TitleIconPath = segments[17].Trim();
|
||
|
EffectId = int.Parse(segments[18]);
|
||
|
|
||
|
}
|
||
|
|
||
|
public int Id { get; private set; }
|
||
|
|
||
|
public int Type { get; private set; }
|
||
|
|
||
|
public string InvestitiveDescription { get; private set; }
|
||
|
|
||
|
public string Name { get; private set; }
|
||
|
|
||
|
public string NameImage { get; private set; }
|
||
|
|
||
|
public int TitileClass { get; private set; }
|
||
|
|
||
|
public string TitleName { get; private set; }
|
||
|
|
||
|
public string AttrDesc { get; private set; }
|
||
|
|
||
|
public string GetDesc { get; private set; }
|
||
|
|
||
|
public string ColorLevel { get; private set; }
|
||
|
|
||
|
public int OwnerTime { get; private set; }
|
||
|
|
||
|
public readonly int[] AttrId = new int[2];
|
||
|
public int getAttrIdCount() { return AttrId.Length; }
|
||
|
public int GetAttrIdbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < AttrId.Length)
|
||
|
return AttrId[idx];
|
||
|
return default(int);
|
||
|
}
|
||
|
|
||
|
public readonly int[] AttrVal = new int[2];
|
||
|
public int getAttrValCount() { return AttrVal.Length; }
|
||
|
public int GetAttrValbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < AttrVal.Length)
|
||
|
return AttrVal[idx];
|
||
|
return default(int);
|
||
|
}
|
||
|
|
||
|
public int CombatPower { get; private set; }
|
||
|
|
||
|
public string TitleIconPath { get; private set; }
|
||
|
|
||
|
public int EffectId { get; private set; }
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|