OneShotOneKill/Assets/Script/Table/Tables/table_ItemList.cs

46 lines
1.6 KiB
C#
Raw Normal View History

2026-01-07 21:27:42 +00:00
using CodeStage.AntiCheat.ObscuredTypes;
using Newtonsoft.Json;
using System.Collections.Generic;
public enum eItem { Goods, PC, Seal, Equipment }
public class ItemListTableData : TableDataBase
{
public eItem e_ItemType;
ObscuredInt _ItemID; public int n_ItemID { get { return _ItemID; } set { _ItemID = value; _ItemID.RandomizeCryptoKey(); } }
ObscuredInt _BuyItemID; public int n_BuyItemID { get { return _BuyItemID; } set { _BuyItemID = value; _BuyItemID.RandomizeCryptoKey(); } }
ObscuredInt _BuyPrice; public int n_BuyPrice { get { return _BuyPrice; } set { _BuyPrice = value; _BuyPrice.RandomizeCryptoKey(); } }
public int n_ItemGrade, n_ItemName, n_ItemDesc, n_ItemOrder;
public string s_ItemIcon;
public override string Get_Name() { return table_localtext.Ins.Get_Text(n_ItemName); }
}
public class table_ItemList : table_base
{
public static table_ItemList Ins;
List<ItemListTableData> tableDatas;
Dictionary<int, ItemListTableData> dic_Data = new Dictionary<int, ItemListTableData>();
protected override void Awake()
{
Ins = this;
base.Awake();
}
protected override void Start()
{
tableDatas = JsonConvert.DeserializeObject<List<ItemListTableData>>(json_last);
for (int i = 0; i < tableDatas.Count; i++)
{
var temp = tableDatas[i];
dic_Data.Add(temp.n_ItemID, temp);
}
base.Start();
}
public List<ItemListTableData> Get_DataList() { return tableDatas; }
public ItemListTableData Get_Data_orNull(int id) { return dic_Data.ContainsKey(id) ? dic_Data[id] : null; }
}