public bool HasBehavior(Behavior bh) { return(m_aBehaviors.Contains(bh)); }
public void RemoveBehavior(Behavior bh) { m_aBehaviors.Remove(bh); //TODO if (.Disposed == false), dispose it! }
//TODO: I want to move these methods out to a BehaviorCollection, but I have to read about creating such classes first. //This is true for many collections throughout the project. Important: the owner of such a collection must be notified about adds/removes public void AddBehavior(Behavior bh) { m_aBehaviors.Add(bh); if (bh.Sprite != this) bh.Sprite = this; }
public bool HasBehavior(Behavior bh) { return m_aBehaviors.Contains(bh); }