コード例 #1
0
 public static void Convert(Dictionary <int, DeclareMasterGraduate> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(0, DeclareMasterGraduate.Create(0, StringDefines.Key_20458, 0, 0, 0, StringDefines.Key_20, StringDefines.Key_20, 0));
     data.Add(1, DeclareMasterGraduate.Create(0, StringDefines.Key_20458, 2500, 0, 0, StringDefines.Key_20, StringDefines.Key_20, 1));
     data.Add(2, DeclareMasterGraduate.Create(0, StringDefines.Key_20459, 5000, 0, 0, StringDefines.Key_20, StringDefines.Key_20, 2));
     data.Add(3, DeclareMasterGraduate.Create(1, StringDefines.Key_20460, 7500, 100, 0, StringDefines.Key_20461, StringDefines.Key_20462, 3));
     data.Add(4, DeclareMasterGraduate.Create(1, StringDefines.Key_20463, 10000, 100, 0, StringDefines.Key_20464, StringDefines.Key_20465, 4));
     data.Add(5, DeclareMasterGraduate.Create(1, StringDefines.Key_20466, 12500, 100, 1, StringDefines.Key_20467, StringDefines.Key_20468, 5));
 }
コード例 #2
0
        public static DeclareMasterGraduate Create(int in_graduate, string in_icon, int in_num, int in_proportion, int in_radio, string in_rewards_app, string in_rewards_master, int in_score)
        {
            DeclareMasterGraduate tmp = new DeclareMasterGraduate();

            tmp._graduate       = in_graduate;
            tmp._icon           = in_icon;
            tmp._num            = in_num;
            tmp._proportion     = in_proportion;
            tmp._radio          = in_radio;
            tmp._rewards_app    = in_rewards_app;
            tmp._rewards_master = in_rewards_master;
            tmp._score          = in_score;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareMasterGraduate>(6);
                    foreach (var item in dic)
                    {
                        DeclareMasterGraduate tmp = new DeclareMasterGraduate();
                        tmp.Graduate      = item.Value[0];
                        tmp.Icon          = CfgStringLua.Get(item.Value[1]);
                        tmp.Num           = item.Value[2];
                        tmp.Proportion    = item.Value[3];
                        tmp.Radio         = item.Value[4];
                        tmp.RewardsApp    = CfgStringLua.Get(item.Value[5]);
                        tmp.RewardsMaster = CfgStringLua.Get(item.Value[6]);
                        tmp.Score         = item.Value[7];

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