using CodeStage.AntiCheat.ObscuredTypes; using Newtonsoft.Json; using System.Collections.Generic; public class BattleLevelUpTableData { ObscuredInt _Lv; public int n_Lv { get { return _Lv; } set { _Lv = value; _Lv.RandomizeCryptoKey(); } } ObscuredInt _NextRequireExp; public int n_NextRequireExp { get { return _NextRequireExp; } set { _NextRequireExp = value; _NextRequireExp.RandomizeCryptoKey(); } } ObscuredInt _TotalExp; public int n_TotalExp { get { return _TotalExp; } set { _TotalExp = value; _TotalExp.RandomizeCryptoKey(); } } } public class table_BattleLevelUp : table_base { public static table_BattleLevelUp Ins; List tableDatas; Dictionary dic_data = new Dictionary(); protected override void Awake() { Ins = this; base.Awake(); } protected override void Start() { tableDatas = JsonConvert.DeserializeObject>(json_last); for (int i = 0; i < tableDatas.Count; i++) dic_data.Add(tableDatas[i].n_Lv, tableDatas[i]); base.Start(); } public List Get_DataList() { return tableDatas; } public BattleLevelUpTableData Get_Data_orNull(int id) { return dic_data.ContainsKey(id) ? dic_data[id] : null; } public BattleLevelUpTableData Get_Data(int exp) { for (int i = tableDatas.Count - 1; i >= 0; i--) { if (tableDatas[i].n_TotalExp <= exp) return tableDatas[i]; } return tableDatas[0]; } }