public static void Convert(Dictionary <int, DeclarePet> data) { if (data == null) { return; } data.Clear(); data.Add(1, DeclarePet.Create(80001, 98, 1, StringDefines.Key_11140, 1, StringDefines.Key_20, 0, StringDefines.Key_13333, 1)); data.Add(2, DeclarePet.Create(80002, 105, 2, StringDefines.Key_13334, 1, StringDefines.Key_20, 0, StringDefines.Key_13335, 1)); data.Add(3, DeclarePet.Create(80003, 112, 3, StringDefines.Key_13336, 1, StringDefines.Key_20, 0, StringDefines.Key_13337, 1)); data.Add(4, DeclarePet.Create(80004, 119, 4, StringDefines.Key_13338, 1, StringDefines.Key_20, 0, StringDefines.Key_13339, 1)); data.Add(5, DeclarePet.Create(80005, 134, 5, StringDefines.Key_13340, 1, StringDefines.Key_20, 0, StringDefines.Key_13341, 1)); data.Add(6, DeclarePet.Create(80006, 124, 6, StringDefines.Key_13342, 1, StringDefines.Key_20, 0, StringDefines.Key_13343, 1)); data.Add(7, DeclarePet.Create(80007, 125, 7, StringDefines.Key_13344, 1, StringDefines.Key_20, 0, StringDefines.Key_13345, 1)); data.Add(8, DeclarePet.Create(80008, 126, 8, StringDefines.Key_13346, 1, StringDefines.Key_20, 0, StringDefines.Key_13347, 1)); data.Add(9, DeclarePet.Create(80009, 137, 9, StringDefines.Key_13348, 1, StringDefines.Key_20, 0, StringDefines.Key_13349, 1)); data.Add(14, DeclarePet.Create(80014, 189, 14, StringDefines.Key_13350, 1, StringDefines.Key_13351, 1, StringDefines.Key_13352, 1)); data.Add(10, DeclarePet.Create(80010, 141, 10, StringDefines.Key_13353, 220, StringDefines.Key_20, 0, StringDefines.Key_13354, 1)); data.Add(11, DeclarePet.Create(80011, 155, 11, StringDefines.Key_13355, 220, StringDefines.Key_20, 0, StringDefines.Key_13356, 1)); data.Add(12, DeclarePet.Create(80012, 145, 12, StringDefines.Key_13357, 220, StringDefines.Key_20, 0, StringDefines.Key_13358, 1)); data.Add(13, DeclarePet.Create(80013, 146, 13, StringDefines.Key_13359, 220, StringDefines.Key_20, 0, StringDefines.Key_13360, 1)); data.Add(15, DeclarePet.Create(80015, 165, 15, StringDefines.Key_13361, 220, StringDefines.Key_20, 0, StringDefines.Key_13362, 1)); data.Add(16, DeclarePet.Create(80016, 166, 16, StringDefines.Key_13363, 220, StringDefines.Key_20, 0, StringDefines.Key_13364, 1)); data.Add(20, DeclarePet.Create(80017, 193, 20, StringDefines.Key_13365, 220, StringDefines.Key_20, 0, StringDefines.Key_13366, 1)); data.Add(21, DeclarePet.Create(80018, 197, 21, StringDefines.Key_13367, 220, StringDefines.Key_20, 0, StringDefines.Key_13368, 1)); data.Add(22, DeclarePet.Create(80019, 201, 22, StringDefines.Key_13369, 220, StringDefines.Key_20, 0, StringDefines.Key_13370, 1)); data.Add(23, DeclarePet.Create(80020, 207, 23, StringDefines.Key_13371, 220, StringDefines.Key_20, 0, StringDefines.Key_13372, 1)); data.Add(24, DeclarePet.Create(80021, 213, 24, StringDefines.Key_13373, 220, StringDefines.Key_13374, 1, StringDefines.Key_13375, 1)); data.Add(25, DeclarePet.Create(60037, 778, 25, StringDefines.Key_13376, 0, StringDefines.Key_20, 1, StringDefines.Key_13377, 1)); data.Add(26, DeclarePet.Create(60038, 787, 26, StringDefines.Key_13378, 0, StringDefines.Key_20, 1, StringDefines.Key_13379, 1)); }
public static DeclarePet Create(int in_attack_skill, int in_head, int in_id, string in_name, int in_need_level, string in_need_pet, int in_notice, string in_passive_skill, int in_type) { DeclarePet tmp = new DeclarePet(); tmp._attack_skill = in_attack_skill; tmp._head = in_head; tmp._id = in_id; tmp._name = in_name; tmp._need_level = in_need_level; tmp._need_pet = in_need_pet; tmp._notice = in_notice; tmp._passive_skill = in_passive_skill; tmp._type = in_type; 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[]> >("DataPet"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataPet = require 'Lua/Config/DataPet'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataPet"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclarePet>(23); foreach (var item in dic) { DeclarePet tmp = new DeclarePet(); tmp.AttackSkill = item.Value[0]; tmp.Head = item.Value[1]; tmp.Id = item.Value[2]; tmp.Name = CfgStringLua.Get(item.Value[3]); tmp.NeedLevel = item.Value[4]; tmp.NeedPet = CfgStringLua.Get(item.Value[5]); tmp.Notice = item.Value[6]; tmp.PassiveSkill = CfgStringLua.Get(item.Value[7]); tmp.Type = item.Value[8]; _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "Pet"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclarePet>(23); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "Pet"); } } }