Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/helpers/Player.h
Show All 19 Lines | |||||
/** | /** | ||||
* valid player IDs are non-negative (see ICmpOwnership) | * valid player IDs are non-negative (see ICmpOwnership) | ||||
*/ | */ | ||||
typedef int32_t player_id_t; | typedef int32_t player_id_t; | ||||
static const player_id_t INVALID_PLAYER = -1; | static const player_id_t INVALID_PLAYER = -1; | ||||
/** | |||||
* Maximum # of players supported by the engine, including gaia players (but not the invalid player). | |||||
* This is hardcoded because specific data structures are used for performance that don't necessarily scale. | |||||
*/ | |||||
static const player_id_t MAX_PLAYERS = 15; | |||||
/** | |||||
* Provided for convenience. | |||||
*/ | |||||
static const player_id_t MAX_PLAYER_ID = MAX_PLAYERS-1; | |||||
/** | |||||
* This is used to explicit "0" as gaia where relevant. | |||||
* Currently only used in RangeManager to set the "reveal-all" flag for gaia players. | |||||
* This number doesn't have to be hardcoded as much as the others, but it would likely | |||||
* incur a performance penalty since the compiler wouldn't be able to optimise as well. | |||||
*/ | |||||
static const player_id_t FIRST_NONGAIA_PLAYER_ID = 1; | |||||
#endif // INCLUDED_PLAYER | #endif // INCLUDED_PLAYER |
Wildfire Games · Phabricator