Move some player-specific data out of the bloated GameState class.

Have gameplay objects hold a PlayerState pointer instead of a PlayerNumber and indexing back into GameState.
This will simplify off-screen players (e.g. CPU ghosts, network replicated human players, >2 players using one NoteField)
This commit is contained in:
Chris Danford
2004-12-20 06:25:59 +00:00
parent 52545966e6
commit f840c014a9
70 changed files with 977 additions and 655 deletions
+4 -3
View File
@@ -10,6 +10,7 @@
#include "Course.h"
#include "ScreenMiniMenu.h"
#include "ScreenManager.h"
#include "PlayerState.h"
//
// Defines specific to EditCoursesMenu
@@ -326,8 +327,8 @@ void EditCoursesMenu::Start()
case ROW_ENTRY_PLAYER_OPTIONS:
SCREENMAN->PlayStartSound();
GAMESTATE->m_PlayerOptions[PLAYER_1] = PlayerOptions();
GAMESTATE->m_PlayerOptions[PLAYER_1].FromString( pEntry->modifiers );
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions = PlayerOptions();
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.FromString( pEntry->modifiers );
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromPlayerOptions );
break;
@@ -365,7 +366,7 @@ void EditCoursesMenu::HandleScreenMessage( const ScreenMessage SM )
case SM_BackFromPlayerOptions:
case SM_BackFromSongOptions:
// coming back from PlayerOptions or SongOptions
pEntry->modifiers = GAMESTATE->m_PlayerOptions[PLAYER_1].GetString() + "," + GAMESTATE->m_SongOptions.GetString();
pEntry->modifiers = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetString() + "," + GAMESTATE->m_SongOptions.GetString();
OnRowValueChanged( ROW_ENTRY_PLAYER_OPTIONS );
break;
}