File diff r7317:1d7343ddd282 → r7318:844268a38029
src/player.h
Show inline comments
 
@@ -209,14 +209,14 @@ struct Player {
 
};
 

	
 
uint16 GetDrawStringPlayerColor(PlayerID player);
 

	
 
void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player);
 
void GetNameOfOwner(Owner owner, TileIndex tile);
 
Money CalculateCompanyValue(const Player* p);
 
void InvalidatePlayerWindows(const Player* p);
 
Money CalculateCompanyValue(const Player *p);
 
void InvalidatePlayerWindows(const Player *p);
 
void SetLocalPlayer(PlayerID new_player);
 
#define FOR_ALL_PLAYERS(p) for (p = _players; p != endof(_players); p++)
 

	
 
VARDEF PlayerID _local_player;
 
VARDEF PlayerID _current_player;
 

	
 
@@ -233,13 +233,13 @@ static inline byte ActivePlayerCount()
 
		if (p->is_active) count++;
 
	}
 

	
 
	return count;
 
}
 

	
 
static inline Player* GetPlayer(PlayerID i)
 
static inline Player *GetPlayer(PlayerID i)
 
{
 
	assert(IS_INSIDE_1D(i, PLAYER_FIRST, lengthof(_players)));
 
	return &_players[i];
 
}
 

	
 
static inline bool IsLocalPlayer()
 
@@ -279,13 +279,13 @@ static inline bool ValParamRailtype(uint
 
/** 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
 
 */
 
static inline RailType GetBestRailtype(const Player* p)
 
static inline RailType GetBestRailtype(const Player *p)
 
{
 
	if (HasRailtypeAvail(p, RAILTYPE_MAGLEV)) return RAILTYPE_MAGLEV;
 
	if (HasRailtypeAvail(p, RAILTYPE_MONO)) return RAILTYPE_MONO;
 
	if (HasRailtypeAvail(p, RAILTYPE_ELECTRIC)) return RAILTYPE_ELECTRIC;
 
	return RAILTYPE_RAIL;
 
}