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[]> >("DataMasterSpiritArray"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataMasterSpiritArray = require 'Lua/Config/DataMasterSpiritArray'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataMasterSpiritArray"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclareMasterSpiritArray>(40); foreach (var item in dic) { DeclareMasterSpiritArray tmp = new DeclareMasterSpiritArray(); tmp.ActiveNeedValue = item.Value[0]; tmp.Att = CfgStringLua.Get(item.Value[1]); tmp.Big = item.Value[2]; tmp.CritGet = item.Value[3]; tmp.CritPer = item.Value[4]; tmp.DecGold = item.Value[5]; tmp.EachAdd = item.Value[6]; tmp.EachCount = item.Value[7]; tmp.Id = item.Value[8]; tmp.LimitDecGold = item.Value[9]; tmp.NormalGet = item.Value[10]; tmp.Small = item.Value[11]; tmp.SuperGet = item.Value[12]; tmp.SuperPer = item.Value[13]; tmp.UpNeedExp = item.Value[14]; _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "MasterSpiritArray"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclareMasterSpiritArray>(40); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "MasterSpiritArray"); } } }
public static void Convert(Dictionary <int, DeclareMasterSpiritArray> data) { if (data == null) { return; } data.Clear(); data.Add(101, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 1, 3, 2500, 10, 10, 10, 101, 50, 1, 1, 6, 500, 20)); data.Add(102, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 1, 3, 2500, 10, 10, 10, 102, 50, 1, 2, 6, 500, 60)); data.Add(103, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 1, 3, 2500, 10, 10, 10, 103, 50, 1, 3, 6, 500, 154)); data.Add(104, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 1, 3, 2500, 10, 10, 10, 104, 50, 1, 4, 6, 500, 334)); data.Add(105, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 1, 3, 2500, 10, 10, 10, 105, 50, 1, 5, 6, 500, 635)); data.Add(201, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 2, 3, 2500, 10, 10, 10, 201, 50, 1, 1, 6, 500, 60)); data.Add(202, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 2, 3, 2500, 10, 10, 10, 202, 50, 1, 2, 6, 500, 154)); data.Add(203, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 2, 3, 2500, 10, 10, 10, 203, 50, 1, 3, 6, 500, 334)); data.Add(204, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 2, 3, 2500, 10, 10, 10, 204, 50, 1, 4, 6, 500, 635)); data.Add(205, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 2, 3, 2500, 10, 10, 10, 205, 50, 1, 5, 6, 500, 1100)); data.Add(301, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 3, 3, 2500, 10, 10, 10, 301, 50, 1, 1, 6, 500, 154)); data.Add(302, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 3, 3, 2500, 10, 10, 10, 302, 50, 1, 2, 6, 500, 334)); data.Add(303, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 3, 3, 2500, 10, 10, 10, 303, 50, 1, 3, 6, 500, 635)); data.Add(304, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 3, 3, 2500, 10, 10, 10, 304, 50, 1, 4, 6, 500, 1100)); data.Add(305, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 3, 3, 2500, 10, 10, 10, 305, 50, 1, 5, 6, 500, 1772)); data.Add(401, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 4, 3, 2500, 10, 10, 10, 401, 50, 1, 1, 6, 500, 334)); data.Add(402, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 4, 3, 2500, 10, 10, 10, 402, 50, 1, 2, 6, 500, 635)); data.Add(403, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 4, 3, 2500, 10, 10, 10, 403, 50, 1, 3, 6, 500, 1100)); data.Add(404, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 4, 3, 2500, 10, 10, 10, 404, 50, 1, 4, 6, 500, 1772)); data.Add(405, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 4, 3, 2500, 10, 10, 10, 405, 50, 1, 5, 6, 500, 2703)); data.Add(501, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 5, 3, 2500, 10, 10, 10, 501, 50, 1, 1, 6, 500, 635)); data.Add(502, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 5, 3, 2500, 10, 10, 10, 502, 50, 1, 2, 6, 500, 1100)); data.Add(503, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 5, 3, 2500, 10, 10, 10, 503, 50, 1, 3, 6, 500, 1772)); data.Add(504, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 5, 3, 2500, 10, 10, 10, 504, 50, 1, 4, 6, 500, 2703)); data.Add(505, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 5, 3, 2500, 10, 10, 10, 505, 50, 1, 5, 6, 500, 3944)); data.Add(601, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 6, 3, 2500, 10, 10, 10, 601, 50, 1, 1, 6, 500, 1100)); data.Add(602, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 6, 3, 2500, 10, 10, 10, 602, 50, 1, 2, 6, 500, 1772)); data.Add(603, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 6, 3, 2500, 10, 10, 10, 603, 50, 1, 3, 6, 500, 2703)); data.Add(604, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 6, 3, 2500, 10, 10, 10, 604, 50, 1, 4, 6, 500, 3944)); data.Add(605, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 6, 3, 2500, 10, 10, 10, 605, 50, 1, 5, 6, 500, 5552)); data.Add(701, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 7, 3, 2500, 10, 10, 10, 701, 50, 1, 1, 6, 500, 1772)); data.Add(702, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 7, 3, 2500, 10, 10, 10, 702, 50, 1, 2, 6, 500, 2703)); data.Add(703, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 7, 3, 2500, 10, 10, 10, 703, 50, 1, 3, 6, 500, 3944)); data.Add(704, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 7, 3, 2500, 10, 10, 10, 704, 50, 1, 4, 6, 500, 5552)); data.Add(705, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 7, 3, 2500, 10, 10, 10, 705, 50, 1, 5, 6, 500, 7588)); data.Add(801, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 8, 3, 2500, 10, 10, 10, 801, 50, 1, 1, 6, 500, 2703)); data.Add(802, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 8, 3, 2500, 10, 10, 10, 802, 50, 1, 2, 6, 500, 3944)); data.Add(803, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 8, 3, 2500, 10, 10, 10, 803, 50, 1, 3, 6, 500, 5552)); data.Add(804, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 8, 3, 2500, 10, 10, 10, 804, 50, 1, 4, 6, 500, 7588)); data.Add(805, DeclareMasterSpiritArray.Create(1000, StringDefines.Key_11639, 8, 3, 2500, 10, 10, 10, 805, 50, 1, 5, 6, 500, 10115)); }
public static DeclareMasterSpiritArray Create(int in_activeNeedValue, string in_att, int in_big, int in_critGet, int in_critPer, int in_decGold, int in_eachAdd, int in_eachCount, int in_id, int in_limitDecGold, int in_normalGet, int in_small, int in_superGet, int in_superPer, int in_upNeedExp) { DeclareMasterSpiritArray tmp = new DeclareMasterSpiritArray(); tmp._activeNeedValue = in_activeNeedValue; tmp._att = in_att; tmp._big = in_big; tmp._critGet = in_critGet; tmp._critPer = in_critPer; tmp._decGold = in_decGold; tmp._eachAdd = in_eachAdd; tmp._eachCount = in_eachCount; tmp._id = in_id; tmp._limitDecGold = in_limitDecGold; tmp._normalGet = in_normalGet; tmp._small = in_small; tmp._superGet = in_superGet; tmp._superPer = in_superPer; tmp._upNeedExp = in_upNeedExp; return(tmp); }