Shegotwet/Assets/ResWork/Table/table_album.cs

37 lines
1.0 KiB
C#

using Newtonsoft.Json;
using System.Collections.Generic;
public class albumtabledata : ShowAlbumBase
{
public int n_Index, n_GirlID, n_Coin, n_Gem, n_Heart;
}
public class table_album : table_base
{
public static table_album Ins;
List<albumtabledata> tableDatas;
Dictionary<int, List<albumtabledata>> dic_datas = new Dictionary<int, List<albumtabledata>>();
protected override void Awake()
{
Ins = this;
base.Awake();
}
protected override void Start()
{
tableDatas = JsonConvert.DeserializeObject<List<albumtabledata>>(json_last);
for (int i = 0; i < tableDatas.Count; i++)
{
var temp = tableDatas[i];
if (!dic_datas.ContainsKey(temp.n_GirlID))
dic_datas.Add(temp.n_GirlID, new List<albumtabledata>());
dic_datas[temp.n_GirlID].Add(temp);
}
base.Start();
}
public List<albumtabledata> Get_DataList() { return tableDatas; }
public List<albumtabledata> Get_DataList(int girl) { return dic_datas[girl]; }
}