private void RemoveFirstBehavior() { BaseBehavior firstBehavior = behaviors.First.Value; firstBehavior.EndBehavior(mob); behaviors.RemoveFirst(); }
private void RemoveLastBehavior() { BaseBehavior lastBehavior = behaviors.Last.Value; switch (lastBehavior.State) { case BehaviorState.InProcess: lastBehavior.EndBehavior(mob); break; } behaviors.RemoveLast(); }
public override bool UpdateBehavior(Mob mob) { if (behaviors.Count > 0) { BaseBehavior curBehavior = behaviors.First.Value; if (curBehavior.State == BehaviorState.NotStarted) { curBehavior.StartBehavior(mob); } if (!curBehavior.UpdateBehavior(mob)) { curBehavior.EndBehavior(mob); behaviors.RemoveFirst(); } return(true); } return(false); }