add PlayerStates for MultiPlayers

This commit is contained in:
Chris Danford
2005-08-23 21:07:07 +00:00
parent 6fa9407891
commit 0c57983d0e
6 changed files with 45 additions and 6 deletions
+30
View File
@@ -5,6 +5,25 @@
#include "CommonMetrics.h"
#include "LuaManager.h"
static const CString PlayerNumberNames[] = {
"P1",
"P2",
};
XToString( PlayerNumber, NUM_PLAYERS );
static const CString MultiPlayerNames[] = {
"P1",
"P2",
"P3",
"P4",
"P5",
"P6",
"P7",
"P8",
};
XToString( MultiPlayer, NUM_MultiPlayer );
PlayerNumber GetNextHumanPlayer( PlayerNumber pn )
{
@@ -46,6 +65,17 @@ PlayerNumber GetNextPotentialCpuPlayer( PlayerNumber pn )
return PLAYER_INVALID;
}
MultiPlayer GetNextEnabledMultiPlayer( MultiPlayer mp )
{
for( MultiPlayer p=(MultiPlayer)(mp+1); p<NUM_MultiPlayer; ((int&)p)++ )
{
if( GAMESTATE->IsMultiPlayerEnabled(p) )
return p;
}
return MultiPlayer_INVALID;
}
void LuaPlayerNumber(lua_State* L)
{
FOREACH_PlayerNumber( pn )