/// <summary> /// Removes the specified behavior. /// </summary> /// <param name="behavior">The behavior.</param> public void RemoveBehavior(SteeringBehavior behavior) { List <SteeringBehavior> list; if (SteeringBehaviors.TryGetValue(behavior.Priority, out list)) { list.Remove(behavior); } }
/// <summary> /// Adds the specified behavior. /// </summary> /// <param name="behavior">The behavior.</param> public void AddBehavior(SteeringBehavior behavior) { List <SteeringBehavior> list; SteeringBehaviors.TryGetValue(behavior.Priority, out list); if (list != null) { list.Add(behavior); } else { SteeringBehaviors.Add(behavior.Priority, new List <SteeringBehavior>() { behavior }); } }