Пример #1
0
        public static DeclareHorseAttr Create(string in_attribute, int in_id, string in_name, int in_nocite, int in_progress, int in_skill, string in_up_item)
        {
            DeclareHorseAttr tmp = new DeclareHorseAttr();

            tmp._attribute = in_attribute;
            tmp._id        = in_id;
            tmp._name      = in_name;
            tmp._nocite    = in_nocite;
            tmp._progress  = in_progress;
            tmp._skill     = in_skill;
            tmp._up_item   = in_up_item;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareHorseAttr>(800);
                    foreach (var item in dic)
                    {
                        DeclareHorseAttr tmp = new DeclareHorseAttr();
                        tmp.Attribute = CfgStringLua.Get(item.Value[0]);
                        tmp.Id        = item.Value[1];
                        tmp.Name      = CfgStringLua.Get(item.Value[2]);
                        tmp.Nocite    = item.Value[3];
                        tmp.Progress  = item.Value[4];
                        tmp.Skill     = item.Value[5];
                        tmp.UpItem    = CfgStringLua.Get(item.Value[6]);

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