示例#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);
            }
        }
示例#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);
     }
 }
示例#3
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;
         newState.Begin(this, previousState);
     }
 }
示例#4
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);
     }
 }