Example #1
0
        public static DeclareRechargeDailyTotal Create(string in_award, int in_day, int in_iD, int in_money, int in_position)
        {
            DeclareRechargeDailyTotal tmp = new DeclareRechargeDailyTotal();

            tmp._award    = in_award;
            tmp._day      = in_day;
            tmp._iD       = in_iD;
            tmp._money    = in_money;
            tmp._position = in_position;

            return(tmp);
        }
 public static void Convert(Dictionary <int, DeclareRechargeDailyTotal> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareRechargeDailyTotal.Create(StringDefines.Key_20281, 1, 1, 60, 1));
     data.Add(2, DeclareRechargeDailyTotal.Create(StringDefines.Key_20282, 1, 2, 300, 1));
     data.Add(3, DeclareRechargeDailyTotal.Create(StringDefines.Key_20283, 1, 3, 680, 1));
     data.Add(4, DeclareRechargeDailyTotal.Create(StringDefines.Key_20284, 1, 4, 300, 2));
     data.Add(5, DeclareRechargeDailyTotal.Create(StringDefines.Key_20285, 2, 5, 300, 2));
     data.Add(6, DeclareRechargeDailyTotal.Create(StringDefines.Key_20286, 3, 6, 300, 2));
 }
Example #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[]> >("DataRechargeDailyTotal");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataRechargeDailyTotal = require 'Lua/Config/DataRechargeDailyTotal'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataRechargeDailyTotal");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareRechargeDailyTotal>(6);
                    foreach (var item in dic)
                    {
                        DeclareRechargeDailyTotal tmp = new DeclareRechargeDailyTotal();
                        tmp.Award    = CfgStringLua.Get(item.Value[0]);
                        tmp.Day      = item.Value[1];
                        tmp.ID       = item.Value[2];
                        tmp.Money    = item.Value[3];
                        tmp.Position = item.Value[4];

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