Пример #1
0
        public static DeclarePetRuneName Create(int in_id, string in_name, string in_tex_res)
        {
            DeclarePetRuneName tmp = new DeclarePetRuneName();

            tmp._id      = in_id;
            tmp._name    = in_name;
            tmp._tex_res = in_tex_res;

            return(tmp);
        }
Пример #2
0
 public static void Convert(Dictionary <int, DeclarePetRuneName> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclarePetRuneName.Create(1, StringDefines.Key_20478, StringDefines.Key_20479));
     data.Add(2, DeclarePetRuneName.Create(2, StringDefines.Key_20480, StringDefines.Key_20481));
     data.Add(3, DeclarePetRuneName.Create(3, StringDefines.Key_18743, StringDefines.Key_20482));
     data.Add(4, DeclarePetRuneName.Create(4, StringDefines.Key_20483, StringDefines.Key_20484));
     data.Add(5, DeclarePetRuneName.Create(5, StringDefines.Key_18747, StringDefines.Key_20485));
     data.Add(6, DeclarePetRuneName.Create(6, StringDefines.Key_20486, StringDefines.Key_20487));
 }
Пример #3
0
        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[]> >("DataPetRuneName");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataPetRuneName = require 'Lua/Config/DataPetRuneName'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataPetRuneName");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclarePetRuneName>(6);
                    foreach (var item in dic)
                    {
                        DeclarePetRuneName tmp = new DeclarePetRuneName();
                        tmp.Id     = item.Value[0];
                        tmp.Name   = CfgStringLua.Get(item.Value[1]);
                        tmp.TexRes = CfgStringLua.Get(item.Value[2]);

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "PetRuneName");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclarePetRuneName>(6);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "PetRuneName");
                }
            }
        }