public void Tick() { StateTransision stateTransision = CheckForTransition(); if (stateTransision != null) { SetState(stateTransision.To); } _currentState.Tick(); }
public void AddAnyState(IState to, System.Func <bool> condition) { StateTransision anyStateTransision = new StateTransision(null, to, condition); _anyStateTransisions.Add(anyStateTransision); }
public void AddTransision(IState from, IState to, System.Func <bool> contidion) { StateTransision stateTransision = new StateTransision(from, to, contidion); _stateTransisions.Add(stateTransision); }