91 lines
2.2 KiB
C#
91 lines
2.2 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_ExerciseRoom{
|
|
|
|
public const string TAB_FILE_DATA = "ExerciseRoom";
|
|
private const int _varCount = 16;
|
|
|
|
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_ExerciseRoom()
|
|
{
|
|
}
|
|
|
|
public Tab_ExerciseRoom(string line)
|
|
{
|
|
var segments = line.Split('\t');
|
|
Id = int.Parse(segments[0]);
|
|
Level[0] = int.Parse(segments[2]);
|
|
Level[1] = int.Parse(segments[5]);
|
|
Level[2] = int.Parse(segments[8]);
|
|
Level[3] = int.Parse(segments[11]);
|
|
Level[4] = int.Parse(segments[14]);
|
|
MonsterId[0] = int.Parse(segments[3]);
|
|
MonsterId[1] = int.Parse(segments[6]);
|
|
MonsterId[2] = int.Parse(segments[9]);
|
|
MonsterId[3] = int.Parse(segments[12]);
|
|
MonsterId[4] = int.Parse(segments[15]);
|
|
Pos[0] = segments[4].Trim();
|
|
Pos[1] = segments[7].Trim();
|
|
Pos[2] = segments[10].Trim();
|
|
Pos[3] = segments[13].Trim();
|
|
Pos[4] = segments[16].Trim();
|
|
|
|
}
|
|
|
|
public int Id { get; private set; }
|
|
|
|
public readonly int[] Level = new int[5];
|
|
public int getLevelCount() { return Level.Length; }
|
|
public int GetLevelbyIndex(int idx)
|
|
{
|
|
if(idx >= 0 && idx < Level.Length)
|
|
return Level[idx];
|
|
return default(int);
|
|
}
|
|
|
|
public readonly int[] MonsterId = new int[5];
|
|
public int getMonsterIdCount() { return MonsterId.Length; }
|
|
public int GetMonsterIdbyIndex(int idx)
|
|
{
|
|
if(idx >= 0 && idx < MonsterId.Length)
|
|
return MonsterId[idx];
|
|
return default(int);
|
|
}
|
|
|
|
public readonly string[] Pos = new string[5];
|
|
public int getPosCount() { return Pos.Length; }
|
|
public string GetPosbyIndex(int idx)
|
|
{
|
|
if(idx >= 0 && idx < Pos.Length)
|
|
return Pos[idx];
|
|
return default(string);
|
|
}
|
|
|
|
|
|
}
|
|
} |