Esempio n. 1
0
        public static DeclareCharacters Create(string in_dinner_1, string in_dinner_2, string in_dinner_3, string in_error_reward, Int64 in_exp, Int64 in_expPool, int in_level, int in_power, string in_sZZQ_EXP_award, string in_sZZQ_EXP_rank_award)
        {
            DeclareCharacters tmp = new DeclareCharacters();

            tmp._dinner_1            = in_dinner_1;
            tmp._dinner_2            = in_dinner_2;
            tmp._dinner_3            = in_dinner_3;
            tmp._error_reward        = in_error_reward;
            tmp._exp                 = in_exp;
            tmp._expPool             = in_expPool;
            tmp._level               = in_level;
            tmp._power               = in_power;
            tmp._sZZQ_EXP_award      = in_sZZQ_EXP_award;
            tmp._sZZQ_EXP_rank_award = in_sZZQ_EXP_rank_award;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareCharacters>(800);
                    foreach (var item in dic)
                    {
                        DeclareCharacters tmp = new DeclareCharacters();
                        tmp.Dinner1          = CfgStringLua.Get(item.Value[0]);
                        tmp.Dinner2          = CfgStringLua.Get(item.Value[1]);
                        tmp.Dinner3          = CfgStringLua.Get(item.Value[2]);
                        tmp.ErrorReward      = CfgStringLua.Get(item.Value[3]);
                        tmp.Exp              = item.Value[4];
                        tmp.ExpPool          = item.Value[5];
                        tmp.Level            = item.Value[6];
                        tmp.Power            = item.Value[7];
                        tmp.SZZQEXPAward     = CfgStringLua.Get(item.Value[8]);
                        tmp.SZZQEXPRankAward = CfgStringLua.Get(item.Value[9]);

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