Example #1
0
        public static DeclareMilitaryRankTask Create(string in_award, int in_id, int in_need_kill)
        {
            DeclareMilitaryRankTask tmp = new DeclareMilitaryRankTask();

            tmp._award     = in_award;
            tmp._id        = in_id;
            tmp._need_kill = in_need_kill;

            return(tmp);
        }
Example #2
0
 public static void Convert(Dictionary <int, DeclareMilitaryRankTask> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareMilitaryRankTask.Create(StringDefines.Key_38183, 1, 5));
     data.Add(2, DeclareMilitaryRankTask.Create(StringDefines.Key_38184, 2, 15));
     data.Add(3, DeclareMilitaryRankTask.Create(StringDefines.Key_38185, 3, 25));
     data.Add(4, DeclareMilitaryRankTask.Create(StringDefines.Key_38186, 4, 50));
     data.Add(5, DeclareMilitaryRankTask.Create(StringDefines.Key_38187, 5, 100));
     data.Add(6, DeclareMilitaryRankTask.Create(StringDefines.Key_38188, 6, 200));
     data.Add(7, DeclareMilitaryRankTask.Create(StringDefines.Key_38189, 7, 500));
     data.Add(8, DeclareMilitaryRankTask.Create(StringDefines.Key_38190, 8, 700));
     data.Add(9, DeclareMilitaryRankTask.Create(StringDefines.Key_38191, 9, 1000));
     data.Add(10, DeclareMilitaryRankTask.Create(StringDefines.Key_38194, 10, 2000));
 }
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[]> >("DataMilitaryRankTask");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataMilitaryRankTask = require 'Lua/Config/DataMilitaryRankTask'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataMilitaryRankTask");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareMilitaryRankTask>(10);
                    foreach (var item in dic)
                    {
                        DeclareMilitaryRankTask tmp = new DeclareMilitaryRankTask();
                        tmp.Award    = CfgStringLua.Get(item.Value[0]);
                        tmp.Id       = item.Value[1];
                        tmp.NeedKill = item.Value[2];

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