Ejemplo n.º 1
0
        public static DeclareMasterKeepsake Create(string in_att, int in_icon, int in_lv, string in_name, int in_radio, int in_upNeed)
        {
            DeclareMasterKeepsake tmp = new DeclareMasterKeepsake();

            tmp._att    = in_att;
            tmp._icon   = in_icon;
            tmp._lv     = in_lv;
            tmp._name   = in_name;
            tmp._radio  = in_radio;
            tmp._upNeed = in_upNeed;

            return(tmp);
        }
Ejemplo n.º 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[]> >("DataMasterKeepsake");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataMasterKeepsake = require 'Lua/Config/DataMasterKeepsake'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataMasterKeepsake");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareMasterKeepsake>();
                    foreach (var item in dic)
                    {
                        DeclareMasterKeepsake tmp = new DeclareMasterKeepsake();
                        tmp.Att    = CfgStringLua.Get(item.Value[0]);
                        tmp.Icon   = item.Value[1];
                        tmp.Lv     = item.Value[2];
                        tmp.Name   = CfgStringLua.Get(item.Value[3]);
                        tmp.Radio  = item.Value[4];
                        tmp.UpNeed = item.Value[5];

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