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[]> >("DataRetrieveRes"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataRetrieveRes = require 'Lua/Config/DataRetrieveRes'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataRetrieveRes"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclareRetrieveRes>(825); foreach (var item in dic) { DeclareRetrieveRes tmp = new DeclareRetrieveRes(); tmp.Arward = CfgStringLua.Get(item.Value[0]); tmp.ArwardFree = CfgStringLua.Get(item.Value[1]); tmp.Exp = item.Value[2]; tmp.ExpFree = item.Value[3]; tmp.Gold = item.Value[4]; tmp.Id = item.Value[5]; tmp.Item = CfgStringLua.Get(item.Value[6]); tmp.Max = item.Value[7]; tmp.MaxLevel = item.Value[8]; tmp.MinLevel = item.Value[9]; tmp.Name = CfgStringLua.Get(item.Value[10]); tmp.OpenDay = CfgStringLua.Get(item.Value[11]); tmp.OpenVariables = CfgStringLua.Get(item.Value[12]); tmp.Soul = CfgStringLua.Get(item.Value[13]); tmp.SoulFree = CfgStringLua.Get(item.Value[14]); tmp.Type = item.Value[15]; tmp.Update = item.Value[16]; _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "RetrieveRes"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclareRetrieveRes>(825); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "RetrieveRes"); } } }
public static DeclareRetrieveRes Create(string in_arward, string in_arward_free, Int64 in_exp, Int64 in_exp_free, int in_gold, int in_id, string in_item, int in_max, int in_maxLevel, int in_minLevel, string in_name, string in_openDay, string in_openVariables, string in_soul, string in_soul_free, int in_type, int in_update) { DeclareRetrieveRes tmp = new DeclareRetrieveRes(); tmp._arward = in_arward; tmp._arward_free = in_arward_free; tmp._exp = in_exp; tmp._exp_free = in_exp_free; tmp._gold = in_gold; tmp._id = in_id; tmp._item = in_item; tmp._max = in_max; tmp._maxLevel = in_maxLevel; tmp._minLevel = in_minLevel; tmp._name = in_name; tmp._openDay = in_openDay; tmp._openVariables = in_openVariables; tmp._soul = in_soul; tmp._soul_free = in_soul_free; tmp._type = in_type; tmp._update = in_update; return(tmp); }