public static DeclareElvesRunelevel Create(string in_addAttribute, int in_iD, int in_num)
        {
            DeclareElvesRunelevel tmp = new DeclareElvesRunelevel();

            tmp._addAttribute = in_addAttribute;
            tmp._iD           = in_iD;
            tmp._num          = in_num;

            return(tmp);
        }
Example #2
0
 public static void Convert(Dictionary <int, DeclareElvesRunelevel> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(2, DeclareElvesRunelevel.Create(StringDefines.Key_58124, 2, 1));
     data.Add(3, DeclareElvesRunelevel.Create(StringDefines.Key_58124, 3, 1));
     data.Add(4, DeclareElvesRunelevel.Create(StringDefines.Key_58125, 4, 2));
     data.Add(5, DeclareElvesRunelevel.Create(StringDefines.Key_58125, 5, 2));
     data.Add(6, DeclareElvesRunelevel.Create(StringDefines.Key_58126, 6, 3));
     data.Add(7, DeclareElvesRunelevel.Create(StringDefines.Key_58126, 7, 3));
     data.Add(8, DeclareElvesRunelevel.Create(StringDefines.Key_58127, 8, 4));
     data.Add(9, DeclareElvesRunelevel.Create(StringDefines.Key_58128, 9, 5));
     data.Add(10, DeclareElvesRunelevel.Create(StringDefines.Key_58129, 10, 6));
 }
        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[]> >("DataElvesRunelevel");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataElvesRunelevel = require 'Lua/Config/DataElvesRunelevel'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataElvesRunelevel");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareElvesRunelevel>(9);
                    foreach (var item in dic)
                    {
                        DeclareElvesRunelevel tmp = new DeclareElvesRunelevel();
                        tmp.AddAttribute = CfgStringLua.Get(item.Value[0]);
                        tmp.ID           = item.Value[1];
                        tmp.Num          = item.Value[2];

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