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[]> >("DataElvesAdvanced"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataElvesAdvanced = require 'Lua/Config/DataElvesAdvanced'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataElvesAdvanced"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclareElvesAdvanced>(10); foreach (var item in dic) { DeclareElvesAdvanced tmp = new DeclareElvesAdvanced(); tmp.AddAttribute = CfgStringLua.Get(item.Value[0]); tmp.BlessnumLimit = item.Value[1]; tmp.BlessnumMax = item.Value[2]; tmp.BlessnumMin = item.Value[3]; tmp.CatchSelfRes = item.Value[4]; tmp.CatchVfxRes = item.Value[5]; tmp.GoldNum = item.Value[6]; tmp.ItemNum = item.Value[7]; tmp.Layer = item.Value[8]; tmp.Name = CfgStringLua.Get(item.Value[9]); tmp.Notice = item.Value[10]; tmp.PanelShowId = item.Value[11]; tmp.QNameColor = CfgStringLua.Get(item.Value[12]); tmp.UpItem = item.Value[13]; tmp.UpNumMax = item.Value[14]; tmp.UpNumMin = item.Value[15]; tmp.UpProbability = item.Value[16]; _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "ElvesAdvanced"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclareElvesAdvanced>(10); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "ElvesAdvanced"); } } }
public static void Convert(Dictionary <int, DeclareElvesAdvanced> data) { if (data == null) { return; } data.Clear(); data.Add(1, DeclareElvesAdvanced.Create(StringDefines.Key_36142, 5, 5, 1, 52, 42, 20, 1, 1, StringDefines.Key_36143, 0, 55, StringDefines.Key_18545, 50029, 1, 0, 10000)); data.Add(2, DeclareElvesAdvanced.Create(StringDefines.Key_36144, 60, 6, 2, 59, 49, 40, 2, 2, StringDefines.Key_36145, 0, 56, StringDefines.Key_18545, 50029, 10, 5, 400)); data.Add(3, DeclareElvesAdvanced.Create(StringDefines.Key_36146, 140, 7, 2, 58, 48, 40, 2, 3, StringDefines.Key_36147, 0, 57, StringDefines.Key_18545, 50029, 20, 10, 300)); data.Add(4, DeclareElvesAdvanced.Create(StringDefines.Key_36148, 296, 8, 3, 61, 51, 60, 3, 4, StringDefines.Key_36149, 0, 58, StringDefines.Key_18545, 50029, 37, 23, 200)); data.Add(5, DeclareElvesAdvanced.Create(StringDefines.Key_36150, 696, 8, 3, 57, 47, 60, 3, 5, StringDefines.Key_36151, 0, 59, StringDefines.Key_18545, 50029, 87, 56, 200)); data.Add(6, DeclareElvesAdvanced.Create(StringDefines.Key_36152, 900, 9, 4, 56, 46, 80, 4, 6, StringDefines.Key_36153, 1, 60, StringDefines.Key_18545, 50029, 100, 62, 200)); data.Add(7, DeclareElvesAdvanced.Create(StringDefines.Key_36154, 2200, 20, 8, 53, 43, 80, 4, 7, StringDefines.Key_36155, 1, 61, StringDefines.Key_18545, 50029, 110, 68, 100)); data.Add(8, DeclareElvesAdvanced.Create(StringDefines.Key_36156, 2662, 22, 10, 54, 44, 80, 4, 8, StringDefines.Key_36157, 1, 62, StringDefines.Key_18545, 50029, 121, 75, 50)); data.Add(9, DeclareElvesAdvanced.Create(StringDefines.Key_36158, 2926, 22, 10, 55, 45, 100, 5, 9, StringDefines.Key_36159, 1, 63, StringDefines.Key_18545, 50029, 133, 82, 40)); data.Add(10, DeclareElvesAdvanced.Create(StringDefines.Key_18567, 3504, 24, 12, 60, 50, 100, 5, 10, StringDefines.Key_36160, 1, 64, StringDefines.Key_18545, 50029, 146, 90, 30)); }
public static DeclareElvesAdvanced Create(string in_addAttribute, int in_blessnum_limit, int in_blessnum_max, int in_blessnum_min, int in_catch_self_res, int in_catch_vfx_res, int in_gold_num, int in_item_num, int in_layer, string in_name, int in_notice, int in_panel_show_id, string in_q_name_color, int in_up_item, int in_up_num_max, int in_up_num_min, int in_up_probability) { DeclareElvesAdvanced tmp = new DeclareElvesAdvanced(); tmp._addAttribute = in_addAttribute; tmp._blessnum_limit = in_blessnum_limit; tmp._blessnum_max = in_blessnum_max; tmp._blessnum_min = in_blessnum_min; tmp._catch_self_res = in_catch_self_res; tmp._catch_vfx_res = in_catch_vfx_res; tmp._gold_num = in_gold_num; tmp._item_num = in_item_num; tmp._layer = in_layer; tmp._name = in_name; tmp._notice = in_notice; tmp._panel_show_id = in_panel_show_id; tmp._q_name_color = in_q_name_color; tmp._up_item = in_up_item; tmp._up_num_max = in_up_num_max; tmp._up_num_min = in_up_num_min; tmp._up_probability = in_up_probability; return(tmp); }