Example #1
0
 /// <summary>Bind the hunt to the spawn collection. Additive only.</summary>
 public void Bind(MapHunt hunt) {
    foreach (KeyValuePair<uint, GameSpawn> pair in m_data.Engine.Game.Spawns) {
       if (hunt.isMatch(pair.Value))
          pair.Value.Hunt = true;
    }
 }
Example #2
0
      /// <summary>Adds the pattern as a hunt.</summary>
      /// <param name="pattern">A regular expression to compare against the spawn name.</param>
      /// <param name="permanent">Determines if the hunt will be saved with the map data.</param>
      public MapHunt Add(string pattern, bool permanent) {
         if (pattern == "" || m_hunts.ContainsKey(pattern))
            return null;
         try
         {
             Regex.Match("", pattern);
         }
         catch (ArgumentException)
         {
             return null;
         }
         MapHunt hunt = new MapHunt(pattern, permanent);
         m_hunts.Add(pattern, hunt);
         Bind(hunt);

         if (Updated != null)
            Updated(hunt);
         if(DataChanged != null)
            DataChanged();

         return hunt;
      }
Example #3
0
 /// <summary>Removes the hunt from the list.</summary>
 public void Remove(MapHunt hunt) {
    Remove(hunt.Hunt.ToString());
 }
Example #4
0
 private void m_hunts_Updated(MapHunt hunt) {
    if (hunt.Permanent) {
       m_Empty = false;
       Dirty = true;
    }
    if (DataChanged != null)
       DataChanged();
 }