/// <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; } }
/// <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; }
/// <summary>Removes the hunt from the list.</summary> public void Remove(MapHunt hunt) { Remove(hunt.Hunt.ToString()); }
private void m_hunts_Updated(MapHunt hunt) { if (hunt.Permanent) { m_Empty = false; Dirty = true; } if (DataChanged != null) DataChanged(); }