Ejemplo n.º 1
0
 public static void Convert(Dictionary <int, DeclareRechargeDaygift> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareRechargeDaygift.Create(StringDefines.Key_2657, 10, 1, 80049, 2, 1, 1, StringDefines.Key_42275, 1));
     data.Add(3, DeclareRechargeDaygift.Create(StringDefines.Key_2659, 30, 3, 80050, 2, 3, 1, StringDefines.Key_42276, 2));
     data.Add(8, DeclareRechargeDaygift.Create(StringDefines.Key_2661, 80, 8, 80051, 2, 8, 1, StringDefines.Key_42277, 3));
 }
Ejemplo n.º 2
0
        public static DeclareRechargeDaygift Create(string in_desAward, int in_gold, int in_id, int in_itemAward, int in_level, int in_needRecharge, int in_radio, string in_rewards, int in_vip)
        {
            DeclareRechargeDaygift tmp = new DeclareRechargeDaygift();

            tmp._desAward     = in_desAward;
            tmp._gold         = in_gold;
            tmp._id           = in_id;
            tmp._itemAward    = in_itemAward;
            tmp._level        = in_level;
            tmp._needRecharge = in_needRecharge;
            tmp._radio        = in_radio;
            tmp._rewards      = in_rewards;
            tmp._vip          = in_vip;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareRechargeDaygift>(3);
                    foreach (var item in dic)
                    {
                        DeclareRechargeDaygift tmp = new DeclareRechargeDaygift();
                        tmp.DesAward     = CfgStringLua.Get(item.Value[0]);
                        tmp.Gold         = item.Value[1];
                        tmp.Id           = item.Value[2];
                        tmp.ItemAward    = item.Value[3];
                        tmp.Level        = item.Value[4];
                        tmp.NeedRecharge = item.Value[5];
                        tmp.Radio        = item.Value[6];
                        tmp.Rewards      = CfgStringLua.Get(item.Value[7]);
                        tmp.Vip          = item.Value[8];

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