public void Tick() { StateTransition transition = CheckForTransition(); if (transition != null) { SetState(transition.ToNewState); } CurrentState.Tick(); }
public void AddAnyTransition(IState to, Func <bool> predicate) { var stateTranisions = new StateTransition(null, to, predicate); _anyStateTransitions.Add(stateTranisions); }
public void AddTransition(IState from, IState to, Func <bool> predicate) { var stateTransition = new StateTransition(from, to, predicate); _stateTransitions.Add(stateTransition); }