internal StateInfo StateInfoOf(object stateId) { for (int i = 0; i < _states.Count; i++) { var current = _states[i]; if (PlainStateMachineBuilderHelper.AreEquals(stateId, current.StateId)) { return(current); } } return(null); }
internal bool ContainsTransition(object StateFrom, object Trigger, object StateTo) { for (int i = 0; i < _transitions.Count; i++) { var current = _transitions[i]; if (PlainStateMachineBuilderHelper.AreEquals(current.StateFrom, StateFrom) && PlainStateMachineBuilderHelper.AreEquals(current.Trigger, Trigger) && PlainStateMachineBuilderHelper.AreEquals(current.StateTo, StateTo)) { return(true); } } return(false); }
internal bool ContainsState(object stateId) { if (stateId != null) { for (int i = 0; i < _states.Count; i++) { var current = _states[i]; if (PlainStateMachineBuilderHelper.AreEquals(stateId, current.StateId)) { return(true); } } } return(false); }
internal void RemoveState(object stateId) { if (ContainsState(stateId)) { for (int i = 0; i < _states.Count; i++) { var current = _states[i]; if (PlainStateMachineBuilderHelper.AreEquals(stateId, current.StateId)) { _states.RemoveAt(i); if (PlainStateMachineBuilderHelper.AreEquals(current.StateId, InitialStateId)) { SetInitialDefaultStateIfThereIsAny(); } } } } }