Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PlayerNumber.h

Go to the documentation of this file.
00001 /* PlayerNumber */ 00002 00003 #ifndef PlayerNumber_H 00004 #define PlayerNumber_H 00005 00006 #include "RageTypes.h" // for RageColor 00007 #include "EnumHelper.h" 00008 00009 00010 // 00011 // Player number stuff 00012 // 00013 enum PlayerNumber { 00014 PLAYER_1 = 0, 00015 PLAYER_2, 00016 NUM_PLAYERS, // leave this at the end 00017 PLAYER_INVALID 00018 }; 00019 #define FOREACH_PlayerNumber( pn ) FOREACH_ENUM( PlayerNumber, NUM_PLAYERS, pn ) 00020 #define FOREACH_HumanPlayer( pn ) for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextHumanPlayer(pn) ) 00021 #define FOREACH_EnabledPlayer( pn ) for( PlayerNumber pn=GetNextEnabledPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextEnabledPlayer(pn) ) 00022 #define FOREACH_CpuPlayer( pn ) for( PlayerNumber pn=GetNextCpuPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextCpuPlayer(pn) ) 00023 #define FOREACH_PotentialCpuPlayer( pn ) for( PlayerNumber pn=GetNextPotentialCpuPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextPotentialCpuPlayer(pn) ) 00024 00025 PlayerNumber GetNextHumanPlayer( PlayerNumber pn ); 00026 PlayerNumber GetNextEnabledPlayer( PlayerNumber pn ); 00027 PlayerNumber GetNextCpuPlayer( PlayerNumber pn ); 00028 PlayerNumber GetNextPotentialCpuPlayer( PlayerNumber pn ); 00029 00030 const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 }; 00031 00032 RageColor PlayerToColor( PlayerNumber pn ); 00033 RageColor PlayerToColor( int p ); 00034 00035 #endif 00036 00037 /* 00038 * (c) 2001-2004 Chris Danford, Chris Gomez 00039 * All rights reserved. 00040 * 00041 * Permission is hereby granted, free of charge, to any person obtaining a 00042 * copy of this software and associated documentation files (the 00043 * "Software"), to deal in the Software without restriction, including 00044 * without limitation the rights to use, copy, modify, merge, publish, 00045 * distribute, and/or sell copies of the Software, and to permit persons to 00046 * whom the Software is furnished to do so, provided that the above 00047 * copyright notice(s) and this permission notice appear in all copies of 00048 * the Software and that both the above copyright notice(s) and this 00049 * permission notice appear in supporting documentation. 00050 * 00051 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00052 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00053 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00054 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00055 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00056 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00057 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00058 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00059 * PERFORMANCE OF THIS SOFTWARE. 00060 */

Generated on Thu Jan 27 20:57:26 2005 for StepMania by doxygen 1.3.7