示例#1
0
        public static DeclareWorldQuestionReward Create(int in_id, int in_level_max, int in_level_min, string in_reward)
        {
            DeclareWorldQuestionReward tmp = new DeclareWorldQuestionReward();

            tmp._id        = in_id;
            tmp._level_max = in_level_max;
            tmp._level_min = in_level_min;
            tmp._reward    = in_reward;

            return(tmp);
        }
 public static void Convert(Dictionary <int, DeclareWorldQuestionReward> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareWorldQuestionReward.Create(1, 1, 1, StringDefines.Key_57594));
     data.Add(2, DeclareWorldQuestionReward.Create(2, 2, 2, StringDefines.Key_57595));
     data.Add(3, DeclareWorldQuestionReward.Create(3, 5, 3, StringDefines.Key_57596));
     data.Add(4, DeclareWorldQuestionReward.Create(4, 10, 6, StringDefines.Key_57597));
     data.Add(5, DeclareWorldQuestionReward.Create(5, 50, 11, StringDefines.Key_57598));
     data.Add(6, DeclareWorldQuestionReward.Create(6, 100, 51, StringDefines.Key_57599));
     data.Add(7, DeclareWorldQuestionReward.Create(7, 1000, 101, StringDefines.Key_57600));
 }
示例#3
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[]> >("DataWorldQuestionReward");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataWorldQuestionReward = require 'Lua/Config/DataWorldQuestionReward'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataWorldQuestionReward");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareWorldQuestionReward>(7);
                    foreach (var item in dic)
                    {
                        DeclareWorldQuestionReward tmp = new DeclareWorldQuestionReward();
                        tmp.Id       = item.Value[0];
                        tmp.LevelMax = item.Value[1];
                        tmp.LevelMin = item.Value[2];
                        tmp.Reward   = CfgStringLua.Get(item.Value[3]);

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