Esempio n. 1
0
        public static DeclareGrowthFund Create(string in_award, int in_level)
        {
            DeclareGrowthFund tmp = new DeclareGrowthFund();

            tmp._award = in_award;
            tmp._level = in_level;

            return(tmp);
        }
Esempio n. 2
0
 public static void Convert(Dictionary <int, DeclareGrowthFund> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(50, DeclareGrowthFund.Create(StringDefines.Key_58316, 50));
     data.Add(100, DeclareGrowthFund.Create(StringDefines.Key_58317, 100));
     data.Add(150, DeclareGrowthFund.Create(StringDefines.Key_58318, 150));
     data.Add(180, DeclareGrowthFund.Create(StringDefines.Key_58319, 180));
     data.Add(220, DeclareGrowthFund.Create(StringDefines.Key_58320, 220));
     data.Add(260, DeclareGrowthFund.Create(StringDefines.Key_58321, 260));
     data.Add(300, DeclareGrowthFund.Create(StringDefines.Key_58322, 300));
 }
Esempio 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[]> >("DataGrowthFund");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataGrowthFund = require 'Lua/Config/DataGrowthFund'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataGrowthFund");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareGrowthFund>(7);
                    foreach (var item in dic)
                    {
                        DeclareGrowthFund tmp = new DeclareGrowthFund();
                        tmp.Award = CfgStringLua.Get(item.Value[0]);
                        tmp.Level = item.Value[1];

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