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

91 lines
2.2 KiB
C#
Raw 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_Consum{
public const string TAB_FILE_DATA = "Consum";
private const int _varCount = 12;
public int GetId()
{
return Index;
}
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_Consum()
{
}
public Tab_Consum(string line)
{
var segments = line.Split('\t');
Index = int.Parse(segments[0]);
ConsumId = int.Parse(segments[2]);
Level = int.Parse(segments[3]);
ConsumeType[0] = int.Parse(segments[4]);
ConsumeType[1] = int.Parse(segments[7]);
ConsumeType[2] = int.Parse(segments[10]);
ConsumeId[0] = int.Parse(segments[5]);
ConsumeId[1] = int.Parse(segments[8]);
ConsumeId[2] = int.Parse(segments[11]);
ConsumeVal[0] = int.Parse(segments[6]);
ConsumeVal[1] = int.Parse(segments[9]);
ConsumeVal[2] = int.Parse(segments[12]);
}
public int Index { get; private set; }
public int ConsumId { get; private set; }
public int Level { get; private set; }
public readonly int[] ConsumeType = new int[3];
public int getConsumeTypeCount() { return ConsumeType.Length; }
public int GetConsumeTypebyIndex(int idx)
{
if(idx >= 0 && idx < ConsumeType.Length)
return ConsumeType[idx];
return default(int);
}
public readonly int[] ConsumeId = new int[3];
public int getConsumeIdCount() { return ConsumeId.Length; }
public int GetConsumeIdbyIndex(int idx)
{
if(idx >= 0 && idx < ConsumeId.Length)
return ConsumeId[idx];
return default(int);
}
public readonly int[] ConsumeVal = new int[3];
public int getConsumeValCount() { return ConsumeVal.Length; }
public int GetConsumeValbyIndex(int idx)
{
if(idx >= 0 && idx < ConsumeVal.Length)
return ConsumeVal[idx];
return default(int);
}
}
}