public static DeclareShopGift Create(int in_buyID, int in_countTime, int in_goodsID, int in_icon, int in_itemID, string in_itemShow, string in_name) { DeclareShopGift tmp = new DeclareShopGift(); tmp._buyID = in_buyID; tmp._countTime = in_countTime; tmp._goodsID = in_goodsID; tmp._icon = in_icon; tmp._itemID = in_itemID; tmp._itemShow = in_itemShow; tmp._name = in_name; return(tmp); }
public static void Convert(Dictionary <int, DeclareShopGift> data) { if (data == null) { return; } data.Clear(); data.Add(14, DeclareShopGift.Create(80062, 86400, 501001, 2021, 14, StringDefines.Key_12129, StringDefines.Key_2683)); data.Add(50003, DeclareShopGift.Create(80063, 86400, 501002, 2021, 50003, StringDefines.Key_12130, StringDefines.Key_2685)); data.Add(50004, DeclareShopGift.Create(80064, 86400, 501003, 2021, 50004, StringDefines.Key_12131, StringDefines.Key_2687)); data.Add(50045, DeclareShopGift.Create(80065, 86400, 501004, 2021, 50045, StringDefines.Key_12132, StringDefines.Key_2689)); data.Add(50048, DeclareShopGift.Create(80065, 86400, 501004, 2021, 50048, StringDefines.Key_12132, StringDefines.Key_2689)); data.Add(50030, DeclareShopGift.Create(80066, 86400, 501005, 2021, 50030, StringDefines.Key_12133, StringDefines.Key_2691)); data.Add(50029, DeclareShopGift.Create(80066, 86400, 501005, 2021, 50029, StringDefines.Key_12133, StringDefines.Key_2691)); data.Add(2, DeclareShopGift.Create(80067, 86400, 501006, 2021, 2, StringDefines.Key_12139, StringDefines.Key_2693)); }
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[]> >("DataShopGift"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataShopGift = require 'Lua/Config/DataShopGift'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataShopGift"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclareShopGift>(8); foreach (var item in dic) { DeclareShopGift tmp = new DeclareShopGift(); tmp.BuyID = item.Value[0]; tmp.CountTime = item.Value[1]; tmp.GoodsID = item.Value[2]; tmp.Icon = item.Value[3]; tmp.ItemID = item.Value[4]; tmp.ItemShow = CfgStringLua.Get(item.Value[5]); tmp.Name = CfgStringLua.Get(item.Value[6]); _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "ShopGift"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclareShopGift>(8); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "ShopGift"); } } }