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

                 if (dic != null)
                 {
                              _dataCaches = new Dictionary<int, DeclareAncientBoss>();
                     foreach (var item in dic)
                     {
                         DeclareAncientBoss tmp = new DeclareAncientBoss();
                       tmp.BossLevel = item.Value[0];
                       tmp.CloneID = item.Value[1];
                       tmp.Coordinates = CfgStringLua.Get(item.Value[2]);
                       tmp.Describe = CfgStringLua.Get(item.Value[3]);
                       tmp.Drop = CfgStringLua.Get(item.Value[4]);
                       tmp.HeadIcon = item.Value[5];
                       tmp.ID = item.Value[6];
                       tmp.Mapsid = item.Value[7];
                       tmp.MaxLevel = item.Value[8];
                       tmp.MinLevel = item.Value[9];
                       tmp.Monsterid = item.Value[10];
                       tmp.Pos = CfgStringLua.Get(item.Value[11]);
                       tmp.Power = item.Value[12];
                       tmp.Size = item.Value[13];

                         _dataCaches.Add(item.Key, tmp);
                     }
                 }
                 Record(startTime, DateTime.Now.Ticks,"AncientBoss");
             }
             if (_dataCaches == null && _fillDataCallBack != null)
             {
                 if (_dataCaches == null)
                 {
                     long startTime = DateTime.Now.Ticks;
                      _dataCaches = new Dictionary<int, DeclareAncientBoss>();
                      _fillDataCallBack(_dataCaches); 
                      Record(startTime, DateTime.Now.Ticks,"AncientBoss");
                 }
             }
    }
Beispiel #2
0
    public static DeclareAncientBoss Create( int in_bossLevel, int in_cloneID, string in_coordinates, string in_describe, string in_drop, int in_head_icon, int in_iD, int in_mapsid, int in_maxLevel, int in_minLevel, int in_monsterid, string in_pos, int in_power, int in_size )
    {
      DeclareAncientBoss tmp = new DeclareAncientBoss();
      tmp._bossLevel = in_bossLevel;
      tmp._cloneID = in_cloneID;
      tmp._coordinates = in_coordinates;
      tmp._describe = in_describe;
      tmp._drop = in_drop;
      tmp._head_icon = in_head_icon;
      tmp._iD = in_iD;
      tmp._mapsid = in_mapsid;
      tmp._maxLevel = in_maxLevel;
      tmp._minLevel = in_minLevel;
      tmp._monsterid = in_monsterid;
      tmp._pos = in_pos;
      tmp._power = in_power;
      tmp._size = in_size;

      return tmp;
    }