Exemple #1
0
        public static DeclareDiamondinvestLevel Create(int in_diamond, int in_investLevel, int in_level, int in_vip)
        {
            DeclareDiamondinvestLevel tmp = new DeclareDiamondinvestLevel();

            tmp._diamond     = in_diamond;
            tmp._investLevel = in_investLevel;
            tmp._level       = in_level;
            tmp._vip         = in_vip;

            return(tmp);
        }
 public static void Convert(Dictionary <int, DeclareDiamondinvestLevel> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareDiamondinvestLevel.Create(680, 1, 2, 2));
     data.Add(2, DeclareDiamondinvestLevel.Create(1280, 2, 2, 2));
     data.Add(3, DeclareDiamondinvestLevel.Create(1880, 3, 2, 2));
 }
Exemple #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[]> >("DataDiamondinvestLevel");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataDiamondinvestLevel = require 'Lua/Config/DataDiamondinvestLevel'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataDiamondinvestLevel");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareDiamondinvestLevel>(3);
                    foreach (var item in dic)
                    {
                        DeclareDiamondinvestLevel tmp = new DeclareDiamondinvestLevel();
                        tmp.Diamond     = item.Value[0];
                        tmp.InvestLevel = item.Value[1];
                        tmp.Level       = item.Value[2];
                        tmp.Vip         = item.Value[3];

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