Exemplo n.º 1
0
        //-----------------------------------------------------------------------------
        // Player states
        //-----------------------------------------------------------------------------

        // Begin the given player state.
        public void BeginState(PlayerState newState)
        {
            if (state != newState)
            {
                if (state != null)
                {
                    state.End(newState);
                }
                previousState = state;
                state         = newState;
                state.Begin(this, previousState);
            }
        }
Exemplo n.º 2
0
 // Begin the given player state as a special state.
 public void BeginSpecialState(PlayerState newState)
 {
     if (specialState != null && !specialState.IsActive)
     {
         specialState = null;
     }
     if (specialState != newState)
     {
         if (specialState != null)
         {
             specialState.End(newState);
         }
         previousSpecialState = specialState;
         specialState         = newState;
         specialState.Begin(this, previousSpecialState);
     }
 }