File diff r2153:b45e3461c6c4 → r2154:83cf5a3d6634
player.h
Show inline comments
 
@@ -193,14 +193,18 @@ void GetNameOfOwner(byte owner, TileInde
 
int64 CalculateCompanyValue(Player *p);
 
void InvalidatePlayerWindows(Player *p);
 
void AiDoGameLoop(Player *p);
 
void UpdatePlayerMoney32(Player *p);
 
#define FOR_ALL_PLAYERS(p) for(p=_players; p != endof(_players); p++)
 

	
 
extern PlayerID _current_player;
 

	
 
#define MAX_PLAYERS 8
 
VARDEF Player _players[MAX_PLAYERS];
 
// NOSAVE: can be determined from player structs
 
VARDEF byte _player_colors[MAX_PLAYERS];
 

	
 
static inline Player* GetPlayer(uint i)
 
{
 
  assert(i < lengthof(_players));
 
  return &_players[i];
 
}
 
@@ -226,12 +230,15 @@ byte GetPlayerRailtypes(int p);
 
  */
 
static inline bool HasRailtypeAvail(Player *p, RailType Railtype)
 
{
 
	return HASBIT(p->avail_railtypes, Railtype);
 
}
 

	
 
/* Validate functions for rail building */
 
static inline bool ValParamRailtype(uint32 rail) { return HASBIT(GetPlayer(_current_player)->avail_railtypes, rail);}
 

	
 
/** Returns the "best" railtype a player can build.
 
  * As the AI doesn't know what the BEST one is, we
 
  * have our own priority list here. When adding
 
  * new railtypes, modify this function
 
  * @param p the player "in action"
 
  * @return The "best" railtype a player has available