Example #1
0
        public static DeclareElementRuneLevel Create(string in_att, int in_cost, int in_id, int in_level, int in_needExp, int in_type)
        {
            DeclareElementRuneLevel tmp = new DeclareElementRuneLevel();

            tmp._att     = in_att;
            tmp._cost    = in_cost;
            tmp._id      = in_id;
            tmp._level   = in_level;
            tmp._needExp = in_needExp;
            tmp._type    = in_type;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareElementRuneLevel>(1111);
                    foreach (var item in dic)
                    {
                        DeclareElementRuneLevel tmp = new DeclareElementRuneLevel();
                        tmp.Att     = CfgStringLua.Get(item.Value[0]);
                        tmp.Cost    = item.Value[1];
                        tmp.Id      = item.Value[2];
                        tmp.Level   = item.Value[3];
                        tmp.NeedExp = item.Value[4];
                        tmp.Type    = item.Value[5];

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