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

99 lines
2.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_EquipEnchanceRandRate{
public const string TAB_FILE_DATA = "EquipEnchanceRandRate";
private const int _varCount = 25;
public int GetId()
{
return Level;
}
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_EquipEnchanceRandRate()
{
}
public Tab_EquipEnchanceRandRate(string line)
{
var segments = line.Split('\t');
Level = int.Parse(segments[0]);
Weight[0] = int.Parse(segments[2]);
Weight[1] = int.Parse(segments[4]);
Weight[2] = int.Parse(segments[6]);
Weight[3] = int.Parse(segments[8]);
Weight[4] = int.Parse(segments[10]);
Weight[5] = int.Parse(segments[12]);
Weight[6] = int.Parse(segments[14]);
Weight[7] = int.Parse(segments[16]);
Weight[8] = int.Parse(segments[18]);
Weight[9] = int.Parse(segments[20]);
AddRate[0] = float.Parse(segments[3]);
AddRate[1] = float.Parse(segments[5]);
AddRate[2] = float.Parse(segments[7]);
AddRate[3] = float.Parse(segments[9]);
AddRate[4] = float.Parse(segments[11]);
AddRate[5] = float.Parse(segments[13]);
AddRate[6] = float.Parse(segments[15]);
AddRate[7] = float.Parse(segments[17]);
AddRate[8] = float.Parse(segments[19]);
AddRate[9] = float.Parse(segments[21]);
ConsumeSubType = int.Parse(segments[22]);
ConsumeNum = int.Parse(segments[23]);
PlayerLevel = int.Parse(segments[24]);
EquipEnchanceGrade = float.Parse(segments[25]);
}
public int Level { get; private set; }
public readonly int[] Weight = new int[10];
public int getWeightCount() { return Weight.Length; }
public int GetWeightbyIndex(int idx)
{
if(idx >= 0 && idx < Weight.Length)
return Weight[idx];
return default(int);
}
public readonly float[] AddRate = new float[10];
public int getAddRateCount() { return AddRate.Length; }
public float GetAddRatebyIndex(int idx)
{
if(idx >= 0 && idx < AddRate.Length)
return AddRate[idx];
return default(float);
}
public int ConsumeSubType { get; private set; }
public int ConsumeNum { get; private set; }
public int PlayerLevel { get; private set; }
public float EquipEnchanceGrade { get; private set; }
}
}