Esempio n. 1
0
        public virtual T MoveTo(T targetStateKey, FiniteStateChangeEventArgs eventArgs = null)
        {
            if (!this.m_states.ContainsKey(targetStateKey))
            {
                throw new Exception("[FiniteStateMachine::MoveTo()] -> Target state did not exist. Please add the State<T> for key: '" + targetStateKey);
            }
            T previousStateKey = targetStateKey;

            if (this.m_currentState != null)
            {
                previousStateKey = this.m_currentState.StateKey;
                this.m_currentState._End();
            }
            this.m_currentState = this.m_states[targetStateKey];
            this.m_currentState._Begin(eventArgs, previousStateKey);
            return(this.m_currentState.StateKey);
        }
 public override StateType MoveTo(StateType targetStateKey, FiniteStateChangeEventArgs eventArgs = null)
 {
     this.OnStateChange?.Invoke(eventArgs);
     return(base.MoveTo(targetStateKey, eventArgs));
 }
Esempio n. 3
0
 public abstract void Begin(FiniteStateChangeEventArgs eventArgs, T previousStateKey);
Esempio n. 4
0
 public virtual void _Begin(FiniteStateChangeEventArgs eventArgs, T previousStateKey)
 {
     this.Begin(eventArgs, previousStateKey);
 }