JJBB/Assets/Project/Script/GameTables/Table_HonorBattlefieldBase.cs
2024-08-23 15:49:34 +08:00

71 lines
1.6 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_HonorBattlefieldBase{
public const string TAB_FILE_DATA = "HonorBattlefieldBase";
private const int _varCount = 5;
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_HonorBattlefieldBase()
{
}
public Tab_HonorBattlefieldBase(string line)
{
var segments = line.Split('\t');
Id = int.Parse(segments[0]);
SeasonBegin[0] = int.Parse(segments[2]);
SeasonBegin[1] = int.Parse(segments[4]);
SeasonEnd[0] = int.Parse(segments[3]);
SeasonEnd[1] = int.Parse(segments[5]);
}
public int Id { get; private set; }
public readonly int[] SeasonBegin = new int[2];
public int getSeasonBeginCount() { return SeasonBegin.Length; }
public int GetSeasonBeginbyIndex(int idx)
{
if(idx >= 0 && idx < SeasonBegin.Length)
return SeasonBegin[idx];
return default(int);
}
public readonly int[] SeasonEnd = new int[2];
public int getSeasonEndCount() { return SeasonEnd.Length; }
public int GetSeasonEndbyIndex(int idx)
{
if(idx >= 0 && idx < SeasonEnd.Length)
return SeasonEnd[idx];
return default(int);
}
}
}