예제 #1
0
 public static void Convert(Dictionary <int, DeclareUpdateReward> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareUpdateReward.Create(0, 1, StringDefines.Key_11640, StringDefines.Key_11641));
 }
예제 #2
0
        public static DeclareUpdateReward Create(int in_need_update, int in_num, string in_update_info, string in_update_reward)
        {
            DeclareUpdateReward tmp = new DeclareUpdateReward();

            tmp._need_update   = in_need_update;
            tmp._num           = in_num;
            tmp._update_info   = in_update_info;
            tmp._update_reward = in_update_reward;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareUpdateReward>(1);
                    foreach (var item in dic)
                    {
                        DeclareUpdateReward tmp = new DeclareUpdateReward();
                        tmp.NeedUpdate   = item.Value[0];
                        tmp.Num          = item.Value[1];
                        tmp.UpdateInfo   = CfgStringLua.Get(item.Value[2]);
                        tmp.UpdateReward = CfgStringLua.Get(item.Value[3]);

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