Esempio n. 1
0
        public static DeclareActiveMedal Create(string in_att, int in_icon, int in_level, string in_name, int in_radio, int in_upNeedAch)
        {
            DeclareActiveMedal tmp = new DeclareActiveMedal();

            tmp._att       = in_att;
            tmp._icon      = in_icon;
            tmp._level     = in_level;
            tmp._name      = in_name;
            tmp._radio     = in_radio;
            tmp._upNeedAch = in_upNeedAch;

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

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

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