Example #1
0
        public static DeclareSkillLevel Create(int in_costBase, int in_costUp, int in_damageBase, int in_damageUp, int in_id)
        {
            DeclareSkillLevel tmp = new DeclareSkillLevel();

            tmp._costBase   = in_costBase;
            tmp._costUp     = in_costUp;
            tmp._damageBase = in_damageBase;
            tmp._damageUp   = in_damageUp;
            tmp._id         = in_id;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareSkillLevel>(5165);
                    foreach (var item in dic)
                    {
                        DeclareSkillLevel tmp = new DeclareSkillLevel();
                        tmp.CostBase   = item.Value[0];
                        tmp.CostUp     = item.Value[1];
                        tmp.DamageBase = item.Value[2];
                        tmp.DamageUp   = item.Value[3];
                        tmp.Id         = item.Value[4];

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