90 lines
2.3 KiB
C#
90 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_MissionDialog{
|
||
|
|
||
|
public const string TAB_FILE_DATA = "MissionDialog";
|
||
|
private const int _varCount = 22;
|
||
|
|
||
|
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_MissionDialog()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public Tab_MissionDialog(string line)
|
||
|
{
|
||
|
var segments = line.Split('\t');
|
||
|
Id = int.Parse(segments[0]);
|
||
|
ContinueTime = int.Parse(segments[2]);
|
||
|
Dialog[0] = segments[3].Trim();
|
||
|
Dialog[1] = segments[5].Trim();
|
||
|
Dialog[2] = segments[7].Trim();
|
||
|
Dialog[3] = segments[9].Trim();
|
||
|
Dialog[4] = segments[11].Trim();
|
||
|
Dialog[5] = segments[13].Trim();
|
||
|
Dialog[6] = segments[15].Trim();
|
||
|
Dialog[7] = segments[17].Trim();
|
||
|
Dialog[8] = segments[19].Trim();
|
||
|
Dialog[9] = segments[21].Trim();
|
||
|
DialogType[0] = int.Parse(segments[4]) > 0;
|
||
|
DialogType[1] = int.Parse(segments[6]) > 0;
|
||
|
DialogType[2] = int.Parse(segments[8]) > 0;
|
||
|
DialogType[3] = int.Parse(segments[10]) > 0;
|
||
|
DialogType[4] = int.Parse(segments[12]) > 0;
|
||
|
DialogType[5] = int.Parse(segments[14]) > 0;
|
||
|
DialogType[6] = int.Parse(segments[16]) > 0;
|
||
|
DialogType[7] = int.Parse(segments[18]) > 0;
|
||
|
DialogType[8] = int.Parse(segments[20]) > 0;
|
||
|
DialogType[9] = int.Parse(segments[22]) > 0;
|
||
|
|
||
|
}
|
||
|
|
||
|
public int Id { get; private set; }
|
||
|
|
||
|
public int ContinueTime { get; private set; }
|
||
|
|
||
|
public readonly string[] Dialog = new string[10];
|
||
|
public int getDialogCount() { return Dialog.Length; }
|
||
|
public string GetDialogbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < Dialog.Length)
|
||
|
return Dialog[idx];
|
||
|
return default(string);
|
||
|
}
|
||
|
|
||
|
public readonly bool[] DialogType = new bool[10];
|
||
|
public int getDialogTypeCount() { return DialogType.Length; }
|
||
|
public bool GetDialogTypebyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < DialogType.Length)
|
||
|
return DialogType[idx];
|
||
|
return default(bool);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|