97 lines
2.5 KiB
C#
97 lines
2.5 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_MissionQuestion{
|
|
|
|
public const string TAB_FILE_DATA = "MissionQuestion";
|
|
private const int _varCount = 13;
|
|
|
|
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_MissionQuestion()
|
|
{
|
|
}
|
|
|
|
public Tab_MissionQuestion(string line)
|
|
{
|
|
var segments = line.Split('\t');
|
|
Id = int.Parse(segments[0]);
|
|
NpcDialog[0] = segments[2].Trim();
|
|
NpcDialog[1] = segments[6].Trim();
|
|
NpcDialog[2] = segments[10].Trim();
|
|
QuestionBank[0] = int.Parse(segments[3]);
|
|
QuestionBank[1] = int.Parse(segments[7]);
|
|
QuestionBank[2] = int.Parse(segments[11]);
|
|
CorrectDialog[0] = segments[4].Trim();
|
|
CorrectDialog[1] = segments[8].Trim();
|
|
CorrectDialog[2] = segments[12].Trim();
|
|
WrongDialog[0] = segments[5].Trim();
|
|
WrongDialog[1] = segments[9].Trim();
|
|
WrongDialog[2] = segments[13].Trim();
|
|
|
|
}
|
|
|
|
public int Id { get; private set; }
|
|
|
|
public readonly string[] NpcDialog = new string[3];
|
|
public int getNpcDialogCount() { return NpcDialog.Length; }
|
|
public string GetNpcDialogbyIndex(int idx)
|
|
{
|
|
if(idx >= 0 && idx < NpcDialog.Length)
|
|
return NpcDialog[idx];
|
|
return default(string);
|
|
}
|
|
|
|
public readonly int[] QuestionBank = new int[3];
|
|
public int getQuestionBankCount() { return QuestionBank.Length; }
|
|
public int GetQuestionBankbyIndex(int idx)
|
|
{
|
|
if(idx >= 0 && idx < QuestionBank.Length)
|
|
return QuestionBank[idx];
|
|
return default(int);
|
|
}
|
|
|
|
public readonly string[] CorrectDialog = new string[3];
|
|
public int getCorrectDialogCount() { return CorrectDialog.Length; }
|
|
public string GetCorrectDialogbyIndex(int idx)
|
|
{
|
|
if(idx >= 0 && idx < CorrectDialog.Length)
|
|
return CorrectDialog[idx];
|
|
return default(string);
|
|
}
|
|
|
|
public readonly string[] WrongDialog = new string[3];
|
|
public int getWrongDialogCount() { return WrongDialog.Length; }
|
|
public string GetWrongDialogbyIndex(int idx)
|
|
{
|
|
if(idx >= 0 && idx < WrongDialog.Length)
|
|
return WrongDialog[idx];
|
|
return default(string);
|
|
}
|
|
|
|
|
|
}
|
|
} |