public static void Convert(Dictionary <int, DeclareMarriageDinner> data) { if (data == null) { return; } data.Clear(); data.Add(1, DeclareMarriageDinner.Create(10000, StringDefines.Key_13607, 5000, 839, 20, 1, StringDefines.Key_13608, 1, StringDefines.Key_20)); data.Add(2, DeclareMarriageDinner.Create(20000, StringDefines.Key_13609, 10000, 840, 20, 2, StringDefines.Key_13610, 1, StringDefines.Key_20)); data.Add(3, DeclareMarriageDinner.Create(30000, StringDefines.Key_13611, 15000, 841, 20, 3, StringDefines.Key_13612, 1, StringDefines.Key_20)); }
public static DeclareMarriageDinner Create(int in_charm, string in_cost_value, int in_gift_money, int in_icon, int in_join_count, int in_level, string in_name, int in_radio, string in_reward) { DeclareMarriageDinner tmp = new DeclareMarriageDinner(); tmp._charm = in_charm; tmp._cost_value = in_cost_value; tmp._gift_money = in_gift_money; tmp._icon = in_icon; tmp._join_count = in_join_count; tmp._level = in_level; tmp._name = in_name; tmp._radio = in_radio; tmp._reward = in_reward; return(tmp); }
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[]> >("DataMarriageDinner"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataMarriageDinner = require 'Lua/Config/DataMarriageDinner'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataMarriageDinner"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclareMarriageDinner>(3); foreach (var item in dic) { DeclareMarriageDinner tmp = new DeclareMarriageDinner(); tmp.Charm = item.Value[0]; tmp.CostValue = CfgStringLua.Get(item.Value[1]); tmp.GiftMoney = item.Value[2]; tmp.Icon = item.Value[3]; tmp.JoinCount = item.Value[4]; tmp.Level = item.Value[5]; tmp.Name = CfgStringLua.Get(item.Value[6]); tmp.Radio = item.Value[7]; tmp.Reward = CfgStringLua.Get(item.Value[8]); _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "MarriageDinner"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclareMarriageDinner>(3); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "MarriageDinner"); } } }