Files
JJBB/Assets/Project/Script/GameTables/Table_HonorBattlefieldSegment.cs

109 lines
2.9 KiB
C#
Raw Permalink Normal View History

2024-08-23 15:49:34 +08:00
//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_HonorBattlefieldSegment{
public const string TAB_FILE_DATA = "HonorBattlefieldSegment";
private const int _varCount = 18;
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_HonorBattlefieldSegment()
{
}
public Tab_HonorBattlefieldSegment(string line)
{
var segments = line.Split('\t');
Id = int.Parse(segments[0]);
Segment = int.Parse(segments[2]);
SegmentIcon = segments[3].Trim();
SegmentDescIcon = segments[4].Trim();
SegmentNumDescIconIndex = int.Parse(segments[5]);
ScoreMin = int.Parse(segments[6]);
ScoreMax = int.Parse(segments[7]);
AwardId[0] = int.Parse(segments[8]);
AwardId[1] = int.Parse(segments[11]);
AwardId[2] = int.Parse(segments[14]);
AwardSubId[0] = int.Parse(segments[9]);
AwardSubId[1] = int.Parse(segments[12]);
AwardSubId[2] = int.Parse(segments[15]);
AwardCount[0] = int.Parse(segments[10]);
AwardCount[1] = int.Parse(segments[13]);
AwardCount[2] = int.Parse(segments[16]);
RewDesc = segments[17].Trim();
RewPath = segments[18].Trim();
}
public int Id { get; private set; }
public int Segment { get; private set; }
public string SegmentIcon { get; private set; }
public string SegmentDescIcon { get; private set; }
public int SegmentNumDescIconIndex { get; private set; }
public int ScoreMin { get; private set; }
public int ScoreMax { get; private set; }
public readonly int[] AwardId = new int[3];
public int getAwardIdCount() { return AwardId.Length; }
public int GetAwardIdbyIndex(int idx)
{
if(idx >= 0 && idx < AwardId.Length)
return AwardId[idx];
return default(int);
}
public readonly int[] AwardSubId = new int[3];
public int getAwardSubIdCount() { return AwardSubId.Length; }
public int GetAwardSubIdbyIndex(int idx)
{
if(idx >= 0 && idx < AwardSubId.Length)
return AwardSubId[idx];
return default(int);
}
public readonly int[] AwardCount = new int[3];
public int getAwardCountCount() { return AwardCount.Length; }
public int GetAwardCountbyIndex(int idx)
{
if(idx >= 0 && idx < AwardCount.Length)
return AwardCount[idx];
return default(int);
}
public string RewDesc { get; private set; }
public string RewPath { get; private set; }
}
}