コード例 #1
0
ファイル: DataShengwuModel.cs プロジェクト: chenxihan/record
 public static void Convert(Dictionary <int, DeclareShengwuModel> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareShengwuModel.Create(StringDefines.Key_50049, StringDefines.Key_50050, 1213, 1, 10, 1, 70, StringDefines.Key_50049, StringDefines.Key_50050, 70));
     data.Add(2, DeclareShengwuModel.Create(StringDefines.Key_50052, StringDefines.Key_50053, 1214, 2, 10, 1, 71, StringDefines.Key_50052, StringDefines.Key_50053, 71));
     data.Add(3, DeclareShengwuModel.Create(StringDefines.Key_50055, StringDefines.Key_50056, 1215, 3, 10, 1, 72, StringDefines.Key_50055, StringDefines.Key_50056, 72));
     data.Add(4, DeclareShengwuModel.Create(StringDefines.Key_50058, StringDefines.Key_50059, 1216, 4, 10, 1, 73, StringDefines.Key_50058, StringDefines.Key_50059, 73));
     data.Add(5, DeclareShengwuModel.Create(StringDefines.Key_50061, StringDefines.Key_50062, 1217, 5, 10, 1, 74, StringDefines.Key_50061, StringDefines.Key_50062, 74));
     data.Add(6, DeclareShengwuModel.Create(StringDefines.Key_50064, StringDefines.Key_50065, 1220, 6, 10, 1, 75, StringDefines.Key_50064, StringDefines.Key_50065, 75));
     data.Add(7, DeclareShengwuModel.Create(StringDefines.Key_50067, StringDefines.Key_50068, 1221, 7, 10, 1, 76, StringDefines.Key_50067, StringDefines.Key_50068, 76));
     data.Add(8, DeclareShengwuModel.Create(StringDefines.Key_50070, StringDefines.Key_50071, 1222, 8, 10, 1, 77, StringDefines.Key_50070, StringDefines.Key_50071, 77));
 }
コード例 #2
0
        public static DeclareShengwuModel Create(string in_active_attr, string in_active_item, int in_icon, int in_id, int in_max_level, int in_notice, int in_res, string in_train_attr, string in_train_item, int in_ui_Res)
        {
            DeclareShengwuModel tmp = new DeclareShengwuModel();

            tmp._active_attr = in_active_attr;
            tmp._active_item = in_active_item;
            tmp._icon        = in_icon;
            tmp._id          = in_id;
            tmp._max_level   = in_max_level;
            tmp._notice      = in_notice;
            tmp._res         = in_res;
            tmp._train_attr  = in_train_attr;
            tmp._train_item  = in_train_item;
            tmp._ui_Res      = in_ui_Res;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareShengwuModel>(8);
                    foreach (var item in dic)
                    {
                        DeclareShengwuModel tmp = new DeclareShengwuModel();
                        tmp.ActiveAttr = CfgStringLua.Get(item.Value[0]);
                        tmp.ActiveItem = CfgStringLua.Get(item.Value[1]);
                        tmp.Icon       = item.Value[2];
                        tmp.Id         = item.Value[3];
                        tmp.MaxLevel   = item.Value[4];
                        tmp.Notice     = item.Value[5];
                        tmp.Res        = item.Value[6];
                        tmp.TrainAttr  = CfgStringLua.Get(item.Value[7]);
                        tmp.TrainItem  = CfgStringLua.Get(item.Value[8]);
                        tmp.UiRes      = item.Value[9];

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