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

96 lines
2.4 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_PromoteSavvy{
public const string TAB_FILE_DATA = "PromoteSavvy";
private const int _varCount = 24;
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_PromoteSavvy()
{
}
public Tab_PromoteSavvy(string line)
{
var segments = line.Split('\t');
Id = int.Parse(segments[0]);
CostItemId = int.Parse(segments[2]);
CostNum = int.Parse(segments[3]);
AddAptitude = int.Parse(segments[4]);
Weight[0] = int.Parse(segments[5]);
Weight[1] = int.Parse(segments[7]);
Weight[2] = int.Parse(segments[9]);
Weight[3] = int.Parse(segments[11]);
Weight[4] = int.Parse(segments[13]);
Weight[5] = int.Parse(segments[15]);
Weight[6] = int.Parse(segments[17]);
Weight[7] = int.Parse(segments[19]);
Weight[8] = int.Parse(segments[21]);
Weight[9] = int.Parse(segments[23]);
AddVal[0] = float.Parse(segments[6]);
AddVal[1] = float.Parse(segments[8]);
AddVal[2] = float.Parse(segments[10]);
AddVal[3] = float.Parse(segments[12]);
AddVal[4] = float.Parse(segments[14]);
AddVal[5] = float.Parse(segments[16]);
AddVal[6] = float.Parse(segments[18]);
AddVal[7] = float.Parse(segments[20]);
AddVal[8] = float.Parse(segments[22]);
AddVal[9] = float.Parse(segments[24]);
}
public int Id { get; private set; }
public int CostItemId { get; private set; }
public int CostNum { get; private set; }
public int AddAptitude { 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[] AddVal = new float[10];
public int getAddValCount() { return AddVal.Length; }
public float GetAddValbyIndex(int idx)
{
if(idx >= 0 && idx < AddVal.Length)
return AddVal[idx];
return default(float);
}
}
}