public static DeclareGuildInvasion Create(int in_id, string in_ranking) { DeclareGuildInvasion tmp = new DeclareGuildInvasion(); tmp._id = in_id; tmp._ranking = in_ranking; return(tmp); }
public static void Convert(Dictionary <int, DeclareGuildInvasion> data) { if (data == null) { return; } data.Clear(); data.Add(1, DeclareGuildInvasion.Create(1, StringDefines.Key_19970)); data.Add(5, DeclareGuildInvasion.Create(5, StringDefines.Key_19971)); data.Add(20, DeclareGuildInvasion.Create(20, StringDefines.Key_19972)); data.Add(1000, DeclareGuildInvasion.Create(1000, StringDefines.Key_19973)); }
public static void SetData() { if (_dataCaches == null && LuaEnv.isLoadLuaCfg) { long startTime = DateTime.Now.Ticks; Dictionary <int, int[]> dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataGuildInvasion"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataGuildInvasion = require 'Lua/Config/DataGuildInvasion'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataGuildInvasion"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclareGuildInvasion>(4); foreach (var item in dic) { DeclareGuildInvasion tmp = new DeclareGuildInvasion(); tmp.Id = item.Value[0]; tmp.Ranking = CfgStringLua.Get(item.Value[1]); _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "GuildInvasion"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclareGuildInvasion>(4); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "GuildInvasion"); } } }