Пример #1
0
 public static void Convert(Dictionary <int, DeclareHorseMythicalLink> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareHorseMythicalLink.Create(StringDefines.Key_20, 1, StringDefines.Key_56729));
 }
Пример #2
0
        public static DeclareHorseMythicalLink Create(string in_attribute, int in_id, string in_link)
        {
            DeclareHorseMythicalLink tmp = new DeclareHorseMythicalLink();

            tmp._attribute = in_attribute;
            tmp._id        = in_id;
            tmp._link      = in_link;

            return(tmp);
        }
Пример #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[]> >("DataHorseMythicalLink");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataHorseMythicalLink = require 'Lua/Config/DataHorseMythicalLink'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataHorseMythicalLink");
                }

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

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