106 lines
2.8 KiB
C#
106 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_NpcOptionDialog{
|
||
|
|
||
|
public const string TAB_FILE_DATA = "NpcOptionDialog";
|
||
|
private const int _varCount = 27;
|
||
|
|
||
|
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_NpcOptionDialog()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public Tab_NpcOptionDialog(string line)
|
||
|
{
|
||
|
var segments = line.Split('\t');
|
||
|
Id = short.Parse(segments[0]);
|
||
|
CenterText = segments[2].Trim();
|
||
|
IsNeedOpenUI = int.Parse(segments[3]);
|
||
|
OptionText[0] = segments[4].Trim();
|
||
|
OptionText[1] = segments[7].Trim();
|
||
|
OptionText[2] = segments[10].Trim();
|
||
|
OptionText[3] = segments[13].Trim();
|
||
|
OptionText[4] = segments[16].Trim();
|
||
|
OptionText[5] = segments[19].Trim();
|
||
|
OptionText[6] = segments[22].Trim();
|
||
|
OptionText[7] = segments[25].Trim();
|
||
|
OptionFunc[0] = segments[5].Trim();
|
||
|
OptionFunc[1] = segments[8].Trim();
|
||
|
OptionFunc[2] = segments[11].Trim();
|
||
|
OptionFunc[3] = segments[14].Trim();
|
||
|
OptionFunc[4] = segments[17].Trim();
|
||
|
OptionFunc[5] = segments[20].Trim();
|
||
|
OptionFunc[6] = segments[23].Trim();
|
||
|
OptionFunc[7] = segments[26].Trim();
|
||
|
OptionParam[0] = segments[6].Trim();
|
||
|
OptionParam[1] = segments[9].Trim();
|
||
|
OptionParam[2] = segments[12].Trim();
|
||
|
OptionParam[3] = segments[15].Trim();
|
||
|
OptionParam[4] = segments[18].Trim();
|
||
|
OptionParam[5] = segments[21].Trim();
|
||
|
OptionParam[6] = segments[24].Trim();
|
||
|
OptionParam[7] = segments[27].Trim();
|
||
|
|
||
|
}
|
||
|
|
||
|
public short Id { get; private set; }
|
||
|
|
||
|
public string CenterText { get; private set; }
|
||
|
|
||
|
public int IsNeedOpenUI { get; private set; }
|
||
|
|
||
|
public readonly string[] OptionText = new string[8];
|
||
|
public int getOptionTextCount() { return OptionText.Length; }
|
||
|
public string GetOptionTextbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < OptionText.Length)
|
||
|
return OptionText[idx];
|
||
|
return default(string);
|
||
|
}
|
||
|
|
||
|
public readonly string[] OptionFunc = new string[8];
|
||
|
public int getOptionFuncCount() { return OptionFunc.Length; }
|
||
|
public string GetOptionFuncbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < OptionFunc.Length)
|
||
|
return OptionFunc[idx];
|
||
|
return default(string);
|
||
|
}
|
||
|
|
||
|
public readonly string[] OptionParam = new string[8];
|
||
|
public int getOptionParamCount() { return OptionParam.Length; }
|
||
|
public string GetOptionParambyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < OptionParam.Length)
|
||
|
return OptionParam[idx];
|
||
|
return default(string);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|