Example #1
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[]> >("DataMasterHoly");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataMasterHoly = require 'Lua/Config/DataMasterHoly'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataMasterHoly");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareMasterHoly>();
                    foreach (var item in dic)
                    {
                        DeclareMasterHoly tmp = new DeclareMasterHoly();
                        tmp.ActiveAttribute = CfgStringLua.Get(item.Value[0]);
                        tmp.ActiveNeedValue = item.Value[1];
                        tmp.ActivePoint     = CfgStringLua.Get(item.Value[2]);
                        tmp.CanFree         = item.Value[3];
                        tmp.CanUpNum        = item.Value[4];
                        tmp.Describe        = CfgStringLua.Get(item.Value[5]);
                        tmp.Frame           = item.Value[6];
                        tmp.Group           = item.Value[7];
                        tmp.Icon            = item.Value[8];
                        tmp.Id           = item.Value[9];
                        tmp.Name         = CfgStringLua.Get(item.Value[10]);
                        tmp.SpecialAtt   = CfgStringLua.Get(item.Value[11]);
                        tmp.Type         = item.Value[12];
                        tmp.UpAttribute  = CfgStringLua.Get(item.Value[13]);
                        tmp.UpNeendValue = item.Value[14];

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "MasterHoly");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareMasterHoly>();
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "MasterHoly");
                }
            }
        }
Example #2
0
        public static DeclareMasterHoly Create(string in_activeAttribute, int in_activeNeedValue, string in_activePoint, int in_canFree, int in_canUpNum, string in_describe, int in_frame, int in_group, int in_icon, int in_id, string in_name, string in_specialAtt, int in_type, string in_upAttribute, int in_upNeendValue)
        {
            DeclareMasterHoly tmp = new DeclareMasterHoly();

            tmp._activeAttribute = in_activeAttribute;
            tmp._activeNeedValue = in_activeNeedValue;
            tmp._activePoint     = in_activePoint;
            tmp._canFree         = in_canFree;
            tmp._canUpNum        = in_canUpNum;
            tmp._describe        = in_describe;
            tmp._frame           = in_frame;
            tmp._group           = in_group;
            tmp._icon            = in_icon;
            tmp._id           = in_id;
            tmp._name         = in_name;
            tmp._specialAtt   = in_specialAtt;
            tmp._type         = in_type;
            tmp._upAttribute  = in_upAttribute;
            tmp._upNeendValue = in_upNeendValue;

            return(tmp);
        }