Пример #1
0
        /// <summary>
        /// Makes the state machine go into another state.
        /// </summary>
        public void TransitionToNewState(StateBase newState, TriggerBase causedByTrigger)
        {
            // exit the current state
            if (this.CurrentState != null)
            {
                this.CurrentState.OnExit(causedByTrigger);
            }

            this.CurrentState = newState;

            UpdateEntityState();
            // enter the new state
            if (this.CurrentState != null)
            {
                this.CurrentState.OnEntry(causedByTrigger);
            }
        }
Пример #2
0
 /// <summary>
 /// Makes the state machine recive a command. Depending on its current state
 /// and the designed transitions the machine reacts to the trigger.
 /// </summary>
 public virtual Task ProcessTriggerAsync(TriggerBase trigger)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 /// <summary>
 /// Makes the state machine recive a command. Depending on its current state
 /// and the designed transitions the machine reacts to the trigger.
 /// </summary>
 public virtual void ProcessTrigger(TriggerBase trigger)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public virtual async Task OnExitAsync(TriggerBase trigger)
 {
 }
Пример #5
0
 /// <summary>
 /// Is executed when the state machine leaves this state.
 /// </summary>
 public virtual void OnExit(TriggerBase trigger)
 {
 }
Пример #6
0
 public virtual async Task OnEntryAsync(TriggerBase trigger)
 {
     trigger.UpdateEntity(this.StateMachine.CurrentEntity);
 }
Пример #7
0
 /// <summary>
 /// Is executed when the state machine enters this state.
 /// </summary>
 public virtual void OnEntry(TriggerBase trigger)
 {
     trigger.UpdateEntity(this.StateMachine.CurrentEntity);
 }
Пример #8
0
 /// <summary>
 /// Makes the state machine recive a command. Depending on its current state
 /// and the designed transitions the machine reacts to the trigger.
 /// </summary>
 public abstract void ProcessTrigger(TriggerBase trigger);