// can't use _minions.remove(m) unless we override object.Equals() public void UnregisterSubject(Monster m) { _removeQueue.Add(m); //Monster monster; //for (int x = 0; x < _minions.Count-1; x++) //{ // monster = (Monster)_minions[x]; // if (monster.ID == m.ID) // { // _minions.RemoveAt(x); // break; // } //} }
public bool Equals(Monster otherMonster) { return ID == otherMonster.ID; }
public void RegisterSubject(Monster m) { m._ID = (_minions.Count + 1); _minions.Add(m); }