Beispiel #1
0
        public static DeclareCampBattleAward Create(string in_awards1, string in_awards2, string in_awards3, int in_level)
        {
            DeclareCampBattleAward tmp = new DeclareCampBattleAward();

            tmp._awards1 = in_awards1;
            tmp._awards2 = in_awards2;
            tmp._awards3 = in_awards3;
            tmp._level   = in_level;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareCampBattleAward>(400);
                    foreach (var item in dic)
                    {
                        DeclareCampBattleAward tmp = new DeclareCampBattleAward();
                        tmp.Awards1 = CfgStringLua.Get(item.Value[0]);
                        tmp.Awards2 = CfgStringLua.Get(item.Value[1]);
                        tmp.Awards3 = CfgStringLua.Get(item.Value[2]);
                        tmp.Level   = item.Value[3];

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