GameState::GetNumHumanPlayers
This commit is contained in:
@@ -674,6 +674,15 @@ bool GameState::IsHumanPlayer( PlayerNumber pn ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GameState::GetNumHumanPlayers() const
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
if( IsHumanPlayer(p) )
|
||||||
|
count++;
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
PlayerNumber GameState::GetFirstHumanPlayer() const
|
PlayerNumber GameState::GetFirstHumanPlayer() const
|
||||||
{
|
{
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public:
|
|||||||
|
|
||||||
bool IsHumanPlayer( PlayerNumber pn ) const;
|
bool IsHumanPlayer( PlayerNumber pn ) const;
|
||||||
bool IsHumanPlayer( int p ) const { return IsHumanPlayer( (PlayerNumber)p ); };
|
bool IsHumanPlayer( int p ) const { return IsHumanPlayer( (PlayerNumber)p ); };
|
||||||
|
int GetNumHumanPlayers() const;
|
||||||
PlayerNumber GetFirstHumanPlayer() const;
|
PlayerNumber GetFirstHumanPlayer() const;
|
||||||
bool IsCpuPlayer( PlayerNumber pn ) const;
|
bool IsCpuPlayer( PlayerNumber pn ) const;
|
||||||
bool IsCpuPlayer( int p ) const { return IsCpuPlayer( (PlayerNumber)p ); };
|
bool IsCpuPlayer( int p ) const { return IsCpuPlayer( (PlayerNumber)p ); };
|
||||||
|
|||||||
Reference in New Issue
Block a user