Esempio n. 1
0
	void CStateModule::Push_State( DC_ID StateID ) {
		if( StateID <= DC_INVALID_ID ) {
			Log(LOG_STATE, "Invalid State ID to Push_State(): %d\n", StateID);
			return;
		}
		
		// Get the State obj
		CState* pNewState = Create_State( StateID );
		
		if( !pNewState ) {
			Log(LOG_STATE, "Could not create State: %d\n", StateID);
			return;
		}
		
		DLog(LOG_STATE, "Pushing State %d\n", StateID);
		
		// If we have a current State, pause it
		CState* pCurState = Get_Current_State();
		if( pCurState ) {
			pCurState->Pause();
		}
		
		// Push the new State on top
		m_StateStack.push_back( pNewState );
		
		// Start the new State
		pNewState->Start();
	}