mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
add gi_setNPlayers()
This commit is contained in:
parent
de41802f54
commit
2a47c91a91
2 changed files with 16 additions and 0 deletions
|
@ -444,6 +444,21 @@ gi_copy( MPFORMAL CurGameInfo* destGI, const CurGameInfo* srcGI )
|
|||
}
|
||||
} /* gi_copy */
|
||||
|
||||
void
|
||||
gi_setNPlayers( CurGameInfo* gi, XP_U16 nTotal, XP_U16 nHere )
|
||||
{
|
||||
assert( nTotal < MAX_NUM_PLAYERS );
|
||||
assert( nHere < nTotal );
|
||||
|
||||
gi->nPlayers = nTotal;
|
||||
|
||||
XP_U16 ii;
|
||||
for ( ii = 0; ii < nTotal; ++ii ) {
|
||||
gi->players[ii].isLocal = ii < nHere;
|
||||
XP_ASSERT( !LP_IS_ROBOT(&gi->players[ii]) );
|
||||
}
|
||||
}
|
||||
|
||||
XP_U16
|
||||
gi_countLocalPlayers( const CurGameInfo* gi, XP_Bool humanOnly )
|
||||
{
|
||||
|
|
|
@ -83,6 +83,7 @@ void game_getState( const XWGame* game, GameStateInfo* gsi );
|
|||
|
||||
void gi_initPlayerInfo( MPFORMAL CurGameInfo* gi,
|
||||
const XP_UCHAR* nameTemplate );
|
||||
void gi_setNPlayers( CurGameInfo* gi, XP_U16 nTotal, XP_U16 nHere );
|
||||
void gi_disposePlayerInfo( MPFORMAL CurGameInfo* gi );
|
||||
void gi_writeToStream( XWStreamCtxt* stream, const CurGameInfo* gi );
|
||||
void gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi );
|
||||
|
|
Loading…
Add table
Reference in a new issue