const fixes
pull code out of the header
This commit is contained in:
+37
-15
@@ -420,21 +420,21 @@ float GameState::GetSongPercent( float beat ) const
|
|||||||
return (beat - m_pCurSong->m_fFirstBeat) / m_pCurSong->m_fLastBeat;
|
return (beat - m_pCurSong->m_fFirstBeat) / m_pCurSong->m_fLastBeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GameState::GetStageIndex()
|
int GameState::GetStageIndex() const
|
||||||
{
|
{
|
||||||
return m_iCurrentStageIndex;
|
return m_iCurrentStageIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GameState::GetNumStagesLeft()
|
int GameState::GetNumStagesLeft() const
|
||||||
{
|
{
|
||||||
if(GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2())
|
if( IsExtraStage() || IsExtraStage2() )
|
||||||
return 1;
|
return 1;
|
||||||
if( PREFSMAN->m_bEventMode )
|
if( PREFSMAN->m_bEventMode )
|
||||||
return 999;
|
return 999;
|
||||||
return PREFSMAN->m_iNumArcadeStages - m_iCurrentStageIndex;
|
return PREFSMAN->m_iNumArcadeStages - m_iCurrentStageIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameState::IsFinalStage()
|
bool GameState::IsFinalStage() const
|
||||||
{
|
{
|
||||||
if( PREFSMAN->m_bEventMode )
|
if( PREFSMAN->m_bEventMode )
|
||||||
return false;
|
return false;
|
||||||
@@ -445,21 +445,21 @@ bool GameState::IsFinalStage()
|
|||||||
return m_iCurrentStageIndex + iPredictedStageForCurSong == PREFSMAN->m_iNumArcadeStages;
|
return m_iCurrentStageIndex + iPredictedStageForCurSong == PREFSMAN->m_iNumArcadeStages;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameState::IsExtraStage()
|
bool GameState::IsExtraStage() const
|
||||||
{
|
{
|
||||||
if( PREFSMAN->m_bEventMode )
|
if( PREFSMAN->m_bEventMode )
|
||||||
return false;
|
return false;
|
||||||
return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages;
|
return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameState::IsExtraStage2()
|
bool GameState::IsExtraStage2() const
|
||||||
{
|
{
|
||||||
if( PREFSMAN->m_bEventMode )
|
if( PREFSMAN->m_bEventMode )
|
||||||
return false;
|
return false;
|
||||||
return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages+1;
|
return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CString GameState::GetStageText()
|
CString GameState::GetStageText() const
|
||||||
{
|
{
|
||||||
if( m_bDemonstrationOrJukebox ) return "demo";
|
if( m_bDemonstrationOrJukebox ) return "demo";
|
||||||
else if( m_PlayMode == PLAY_MODE_ONI ) return "oni";
|
else if( m_PlayMode == PLAY_MODE_ONI ) return "oni";
|
||||||
@@ -472,7 +472,7 @@ CString GameState::GetStageText()
|
|||||||
else return ssprintf("%d",m_iCurrentStageIndex+1);
|
else return ssprintf("%d",m_iCurrentStageIndex+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameState::GetAllStageTexts( CStringArray &out )
|
void GameState::GetAllStageTexts( CStringArray &out ) const
|
||||||
{
|
{
|
||||||
out.clear();
|
out.clear();
|
||||||
out.push_back( "demo" );
|
out.push_back( "demo" );
|
||||||
@@ -487,7 +487,7 @@ void GameState::GetAllStageTexts( CStringArray &out )
|
|||||||
out.push_back( ssprintf("%d",stage+1) );
|
out.push_back( ssprintf("%d",stage+1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
int GameState::GetCourseSongIndex()
|
int GameState::GetCourseSongIndex() const
|
||||||
{
|
{
|
||||||
int iSongIndex = 0;
|
int iSongIndex = 0;
|
||||||
/* iSongsPlayed includes the current song, so it's 1-based; subtract one. */
|
/* iSongsPlayed includes the current song, so it's 1-based; subtract one. */
|
||||||
@@ -517,15 +517,14 @@ GameDef* GameState::GetCurrentGameDef()
|
|||||||
return GAMEMAN->GetGameDefForGame( m_CurGame );
|
return GAMEMAN->GetGameDefForGame( m_CurGame );
|
||||||
}
|
}
|
||||||
|
|
||||||
const StyleDef* GameState::GetCurrentStyleDef()
|
const StyleDef* GameState::GetCurrentStyleDef() const
|
||||||
{
|
{
|
||||||
|
|
||||||
ASSERT( m_CurStyle != STYLE_INVALID ); // the style must be set before calling this
|
ASSERT( m_CurStyle != STYLE_INVALID ); // the style must be set before calling this
|
||||||
return GAMEMAN->GetStyleDefForStyle( m_CurStyle );
|
return GAMEMAN->GetStyleDefForStyle( m_CurStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GameState::IsPlayerEnabled( PlayerNumber pn )
|
bool GameState::IsPlayerEnabled( PlayerNumber pn ) const
|
||||||
{
|
{
|
||||||
// In rave, all players are present. Non-human players are CPU controlled.
|
// In rave, all players are present. Non-human players are CPU controlled.
|
||||||
switch( m_PlayMode )
|
switch( m_PlayMode )
|
||||||
@@ -538,7 +537,16 @@ bool GameState::IsPlayerEnabled( PlayerNumber pn )
|
|||||||
return IsHumanPlayer( pn );
|
return IsHumanPlayer( pn );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameState::IsHumanPlayer( PlayerNumber pn )
|
int GameState::GetNumPlayersEnabled() const
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
if( IsPlayerEnabled(p) )
|
||||||
|
count++;
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GameState::IsHumanPlayer( PlayerNumber pn ) const
|
||||||
{
|
{
|
||||||
if( m_CurStyle == STYLE_INVALID ) // no style chosen
|
if( m_CurStyle == STYLE_INVALID ) // no style chosen
|
||||||
if( this->PlayersCanJoin() )
|
if( this->PlayersCanJoin() )
|
||||||
@@ -559,7 +567,7 @@ bool GameState::IsHumanPlayer( PlayerNumber pn )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerNumber GameState::GetFirstHumanPlayer()
|
PlayerNumber GameState::GetFirstHumanPlayer() const
|
||||||
{
|
{
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
if( IsHumanPlayer(p) )
|
if( IsHumanPlayer(p) )
|
||||||
@@ -568,11 +576,19 @@ PlayerNumber GameState::GetFirstHumanPlayer()
|
|||||||
return PLAYER_INVALID;
|
return PLAYER_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameState::IsCpuPlayer( PlayerNumber pn )
|
bool GameState::IsCpuPlayer( PlayerNumber pn ) const
|
||||||
{
|
{
|
||||||
return IsPlayerEnabled(pn) && !IsHumanPlayer(pn);
|
return IsPlayerEnabled(pn) && !IsHumanPlayer(pn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GameState::AnyPlayersAreCpu() const
|
||||||
|
{
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
if( IsCpuPlayer(p) )
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GameState::IsCourseMode() const
|
bool GameState::IsCourseMode() const
|
||||||
{
|
{
|
||||||
@@ -897,6 +913,12 @@ void GameState::RebuildPlayerOptionsFromActiveAttacks( PlayerNumber pn )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameState::RemoveAllActiveAttacks() // called on end of song
|
||||||
|
{
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
RemoveActiveAttacksForPlayer( (PlayerNumber)p );
|
||||||
|
}
|
||||||
|
|
||||||
int GameState::GetSumOfActiveAttackLevels( PlayerNumber pn )
|
int GameState::GetSumOfActiveAttackLevels( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
int iSum = 0;
|
int iSum = 0;
|
||||||
|
|||||||
+21
-36
@@ -67,31 +67,20 @@ public:
|
|||||||
int GetNumSidesJoined() const;
|
int GetNumSidesJoined() const;
|
||||||
|
|
||||||
GameDef* GetCurrentGameDef();
|
GameDef* GetCurrentGameDef();
|
||||||
const StyleDef* GetCurrentStyleDef();
|
const StyleDef* GetCurrentStyleDef() const;
|
||||||
|
|
||||||
void GetPlayerInfo( PlayerNumber pn, bool& bIsEnabledOut, bool& bIsHumanOut );
|
void GetPlayerInfo( PlayerNumber pn, bool& bIsEnabledOut, bool& bIsHumanOut );
|
||||||
bool IsPlayerEnabled( PlayerNumber pn );
|
bool IsPlayerEnabled( PlayerNumber pn ) const;
|
||||||
bool IsPlayerEnabled( int p ) { return IsPlayerEnabled( (PlayerNumber)p ); };
|
bool IsPlayerEnabled( int p ) const { return IsPlayerEnabled( (PlayerNumber)p ); };
|
||||||
int GetNumPlayersEnabled()
|
int GetNumPlayersEnabled() const;
|
||||||
{
|
|
||||||
int count = 0;
|
bool IsHumanPlayer( PlayerNumber pn ) const;
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
bool IsHumanPlayer( int p ) const { return IsHumanPlayer( (PlayerNumber)p ); };
|
||||||
if( IsPlayerEnabled(p) )
|
PlayerNumber GetFirstHumanPlayer() const;
|
||||||
count++;
|
bool IsCpuPlayer( PlayerNumber pn ) const;
|
||||||
return count;
|
bool IsCpuPlayer( int p ) const { return IsCpuPlayer( (PlayerNumber)p ); };
|
||||||
};
|
bool AnyPlayersAreCpu() const;
|
||||||
bool IsHumanPlayer( PlayerNumber pn );
|
|
||||||
bool IsHumanPlayer( int p ) { return IsHumanPlayer( (PlayerNumber)p ); };
|
|
||||||
PlayerNumber GetFirstHumanPlayer();
|
|
||||||
bool IsCpuPlayer( PlayerNumber pn );
|
|
||||||
bool IsCpuPlayer( int p ) { return IsCpuPlayer( (PlayerNumber)p ); };
|
|
||||||
bool AnyPlayersAreCpu()
|
|
||||||
{
|
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
||||||
if( IsCpuPlayer(p) )
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
void GetCharacters( vector<Character*> &apCharactersOut );
|
void GetCharacters( vector<Character*> &apCharactersOut );
|
||||||
Character* GameState::GetRandomCharacter();
|
Character* GameState::GetRandomCharacter();
|
||||||
Character* GameState::GetDefaultCharacter();
|
Character* GameState::GetDefaultCharacter();
|
||||||
@@ -119,14 +108,14 @@ public:
|
|||||||
bool m_bJukeboxUsesModifiers;
|
bool m_bJukeboxUsesModifiers;
|
||||||
int m_iCurrentStageIndex; // incremented on Eval screen. For a Course, this is always 0
|
int m_iCurrentStageIndex; // incremented on Eval screen. For a Course, this is always 0
|
||||||
|
|
||||||
int GetStageIndex();
|
int GetStageIndex() const;
|
||||||
int GetNumStagesLeft();
|
int GetNumStagesLeft() const;
|
||||||
bool IsFinalStage();
|
bool IsFinalStage() const;
|
||||||
bool IsExtraStage();
|
bool IsExtraStage() const;
|
||||||
bool IsExtraStage2();
|
bool IsExtraStage2() const;
|
||||||
CString GetStageText();
|
CString GetStageText() const;
|
||||||
void GetAllStageTexts( CStringArray &out );
|
void GetAllStageTexts( CStringArray &out ) const;
|
||||||
int GetCourseSongIndex();
|
int GetCourseSongIndex() const;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -193,11 +182,7 @@ public:
|
|||||||
void GetUndisplayedBeats( PlayerNumber pn, float TotalSeconds, float &StartBeat, float &EndBeat ); // only meaningful when a NoteField is in use
|
void GetUndisplayedBeats( PlayerNumber pn, float TotalSeconds, float &StartBeat, float &EndBeat ); // only meaningful when a NoteField is in use
|
||||||
void LaunchAttack( PlayerNumber target, Attack aa );
|
void LaunchAttack( PlayerNumber target, Attack aa );
|
||||||
void RebuildPlayerOptionsFromActiveAttacks( PlayerNumber pn );
|
void RebuildPlayerOptionsFromActiveAttacks( PlayerNumber pn );
|
||||||
void RemoveAllActiveAttacks() // called on end of song
|
void RemoveAllActiveAttacks(); // called on end of song
|
||||||
{
|
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
||||||
RemoveActiveAttacksForPlayer( (PlayerNumber)p );
|
|
||||||
}
|
|
||||||
void RemoveActiveAttacksForPlayer( PlayerNumber pn, AttackLevel al=NUM_ATTACK_LEVELS /*all*/ );
|
void RemoveActiveAttacksForPlayer( PlayerNumber pn, AttackLevel al=NUM_ATTACK_LEVELS /*all*/ );
|
||||||
void RemoveAllInventory();
|
void RemoveAllInventory();
|
||||||
int GetSumOfActiveAttackLevels( PlayerNumber pn );
|
int GetSumOfActiveAttackLevels( PlayerNumber pn );
|
||||||
|
|||||||
Reference in New Issue
Block a user