Beispiel #1
0
        /// <summary>
        /// Adds a new state to the StateMachine and pauses the current one if it exists.
        /// </summary>
        /// <param name="state"></param>
        public void PushState(SimState state)
        {
            if (CurrentState != null)
            {
                CurrentState.Pause();
            }

            if (!activeStates.Contains(state))
            {
                activeStates.Push(state);
            }

            CurrentState = state;

            CurrentState.Start();
        }
Beispiel #2
0
        /// <summary>
        /// Adds a new state to the StateMachine and pauses the current one if it exists.
        /// </summary>
        /// <param name="state"></param>
        public void PushState(SimState state)
        {
            if (CurrentState != null)
            {
                CurrentState.Pause();
            }

            CurrentObjectsEnabled = false;

            if (!activeStates.Contains(state))
            {
                activeStates.Push(state);
            }

            CurrentState = state;

            CurrentObjectsEnabled = true;

            CurrentState.Start();
        }