public void AddBehaviour(ISimulativeBehaviour beh) { if (!ContainBehaviour(beh)) { m_Behaviours.Add(beh); beh.Sim = this; } }
public void RemoveBehaviour(ISimulativeBehaviour beh) { if (ContainBehaviour(beh)) { m_Behaviours.Remove(beh); beh.Sim = null; } }
public bool ContainBehaviour(ISimulativeBehaviour beh) { foreach (ISimulativeBehaviour item in m_Behaviours) { if (item == beh) { return(true); } if (item.GetType() == beh.GetType()) { return(true); } } return(false); }