Project_WL/Assets/Script/Table/Dungeon/table_dungeonmapconfig.cs

91 lines
2.5 KiB
C#

using CodeStage.AntiCheat.ObscuredTypes;
using Newtonsoft.Json;
using System.Collections.Generic;
public class DungeonMapConfigTableData : TableDataBase
{
public eDungeon e_DungeonType;
ObscuredInt _MapLv;
public int n_MapLv
{
get { return _MapLv; }
set { _MapLv = value; _MapLv.RandomizeCryptoKey(); }
}
ObscuredInt _MobCount;
public int n_MobCount
{
get { return _MobCount; }
set { _MobCount = value; _MobCount.RandomizeCryptoKey(); }
}
ObscuredInt _SpawnID;
public int n_SpawnID
{
get { return _SpawnID; }
set { _SpawnID = value; _SpawnID.RandomizeCryptoKey(); }
}
ObscuredInt _MobID;
public int n_MobID
{
get { return _MobID; }
set { _MobID = value; _MobID.RandomizeCryptoKey(); }
}
ObscuredFloat _MakeGap;
public float f_MakeGap
{
get { return _MakeGap; }
set { _MakeGap = value; _MakeGap.RandomizeCryptoKey(); }
}
ObscuredFloat _Time;
public float f_Time
{
get { return _Time; }
set { _Time = value; _Time.RandomizeCryptoKey(); }
}
public int Get_DungeonIndex() { return MyEnumToInt.Ins.Get_Int(e_DungeonType) - 1; }
}
public class table_dungeonmapconfig : table_missionbase
{
public static table_dungeonmapconfig Ins;
List<DungeonMapConfigTableData> tableDatas;
Dictionary<eDungeon, List<DungeonMapConfigTableData>> dic_Data = new Dictionary<eDungeon, List<DungeonMapConfigTableData>>();
protected override void Awake()
{
base.Awake();
Ins = this;
}
protected override void Start()
{
tableDatas = JsonConvert.DeserializeObject<List<DungeonMapConfigTableData>>(json_last);
for (int i = 0; i < tableDatas.Count; i++)
{
var data = tableDatas[i];
if (!dic_Data.ContainsKey(data.e_DungeonType))
dic_Data.Add(data.e_DungeonType, new List<DungeonMapConfigTableData>());
dic_Data[data.e_DungeonType].Add(data);
}
base.Start();
}
public List<DungeonMapConfigTableData> Get_DataList() { return tableDatas; }
public List<DungeonMapConfigTableData> Get_DataList(eDungeon dungeon) { return dic_Data[dungeon]; }
public DungeonMapConfigTableData Get_Data_orNull(eDungeon dungeon, int lv)
{
for (int i = 0; i < dic_Data[dungeon].Count; i++)
{
if (dic_Data[dungeon][i].n_MapLv == lv)
return dic_Data[dungeon][i];
}
return null;
}
}