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

78 lines
1.9 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_ShopItemLimit{
public const string TAB_FILE_DATA = "ShopItemLimit";
private const int _varCount = 19;
public int GetId()
{
return LimitID;
}
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_ShopItemLimit()
{
}
public Tab_ShopItemLimit(string line)
{
var segments = line.Split('\t');
LimitID = int.Parse(segments[0]);
LimitType = int.Parse(segments[2]);
VipLv[0] = int.Parse(segments[3]);
VipLv[1] = int.Parse(segments[4]);
VipLv[2] = int.Parse(segments[5]);
VipLv[3] = int.Parse(segments[6]);
VipLv[4] = int.Parse(segments[7]);
VipLv[5] = int.Parse(segments[8]);
VipLv[6] = int.Parse(segments[9]);
VipLv[7] = int.Parse(segments[10]);
VipLv[8] = int.Parse(segments[11]);
VipLv[9] = int.Parse(segments[12]);
VipLv[10] = int.Parse(segments[13]);
VipLv[11] = int.Parse(segments[14]);
VipLv[12] = int.Parse(segments[15]);
VipLv[13] = int.Parse(segments[16]);
VipLv[14] = int.Parse(segments[17]);
VipLv[15] = int.Parse(segments[18]);
VipLv[16] = int.Parse(segments[19]);
}
public int LimitID { get; private set; }
public int LimitType { get; private set; }
public readonly int[] VipLv = new int[17];
public int getVipLvCount() { return VipLv.Length; }
public int GetVipLvbyIndex(int idx)
{
if(idx >= 0 && idx < VipLv.Length)
return VipLv[idx];
return default(int);
}
}
}