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
+3 -2
View File
@@ -23,6 +23,7 @@
#include "UnlockSystem.h"
#include "GameSoundManager.h"
#include "ThemeManager.h"
#include "PlayerState.h"
void GameCommand::Init()
{
@@ -91,12 +92,12 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
if( m_sModifiers != "" )
{
/* Apply modifiers. */
PlayerOptions po = GAMESTATE->m_PlayerOptions[pn];
PlayerOptions po = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions;
SongOptions so = GAMESTATE->m_SongOptions;
po.FromString( m_sModifiers );
so.FromString( m_sModifiers );
if( po != GAMESTATE->m_PlayerOptions[pn] )
if( po != GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions )
return false;
if( so != GAMESTATE->m_SongOptions )
return false;