add gi_countHumans

This commit is contained in:
ehouse 2004-10-30 04:50:33 +00:00
parent 3e4097e9b3
commit 1c199500c3
2 changed files with 14 additions and 0 deletions

View file

@ -313,6 +313,19 @@ gi_copy( MPFORMAL CurGameInfo* destGI, CurGameInfo* srcGI )
}
} /* gi_copy */
XP_U16
gi_countHumans( CurGameInfo* gi )
{
XP_U16 count = 0;
XP_U16 nPlayers = gi->nPlayers;
while ( nPlayers-- ) {
if ( !gi->players[nPlayers].isRobot ) {
++count;
}
}
return count;
} /* gi_countHumans */
void
gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi )
{

View file

@ -91,6 +91,7 @@ void gi_disposePlayerInfo( MPFORMAL CurGameInfo* gi );
void gi_writeToStream( XWStreamCtxt* stream, CurGameInfo* gi );
void gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi );
void gi_copy( MPFORMAL CurGameInfo* destGI, CurGameInfo* srcGi );
XP_U16 gi_countHumans( CurGameInfo* gi );
XP_Bool player_hasPasswd( LocalPlayer* player );
XP_Bool player_passwordMatches( LocalPlayer* player, XP_U8* buf, XP_U16 len );