summaryrefslogtreecommitdiff
path: root/player.h
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-09-18 20:56:44 +0000
committerDarkvater <Darkvater@openttd.org>2005-09-18 20:56:44 +0000
commit4a58250cb9c51d37faec1137f3c9ece79b1a1bb4 (patch)
tree2e474d7261d3d1f3a5a381895f572bd5b78fe606 /player.h
parent3536bbdad04516119670437c0f2d5c9146d6c254 (diff)
downloadopenttd-4a58250cb9c51d37faec1137f3c9ece79b1a1bb4.tar.xz
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
- change a lot of byte player types to PlayerID - beautify header files, same "#endif /* filename */" ending
Diffstat (limited to 'player.h')
-rw-r--r--player.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/player.h b/player.h
index 7b59913f0..001b43f7c 100644
--- a/player.h
+++ b/player.h
@@ -169,7 +169,7 @@ typedef struct Player {
TileIndex location_of_house;
TileIndex last_build_coordinate;
- byte share_owners[4];
+ PlayerID share_owners[4];
byte inaugurated_year;
byte num_valid_stat_ent;
@@ -193,8 +193,8 @@ typedef struct Player {
uint32 engine_renew_money;
} Player;
-void ChangeOwnershipOfPlayerItems(byte old_player, byte new_player);
-void GetNameOfOwner(byte owner, TileIndex tile);
+void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player);
+void GetNameOfOwner(PlayerID owner, TileIndex tile);
int64 CalculateCompanyValue(Player *p);
void InvalidatePlayerWindows(Player *p);
void AiDoGameLoop(Player *p);
@@ -209,7 +209,7 @@ VARDEF Player _players[MAX_PLAYERS];
// NOSAVE: can be determined from player structs
VARDEF byte _player_colors[MAX_PLAYERS];
-static inline Player* GetPlayer(uint i)
+static inline Player* GetPlayer(PlayerID i)
{
assert(i < lengthof(_players));
return &_players[i];
@@ -223,7 +223,7 @@ static inline bool IsLocalPlayer(void)
/** Returns the number of rail types the player can build
* @param *p Player in question
*/
-static inline int GetNumRailtypes(Player *p)
+static inline int GetNumRailtypes(const Player *p)
{
int num = 0;
int i;
@@ -239,7 +239,7 @@ byte GetPlayerRailtypes(int p);
/** Finds out if a Player has a certain railtype available
*/
-static inline bool HasRailtypeAvail(Player *p, RailType Railtype)
+static inline bool HasRailtypeAvail(const Player *p, RailType Railtype)
{
return HASBIT(p->avail_railtypes, Railtype);
}
@@ -254,7 +254,7 @@ static inline bool ValParamRailtype(uint32 rail) { return HASBIT(GetPlayer(_curr
* @param p the player "in action"
* @return The "best" railtype a player has available
*/
-static inline byte GetBestRailtype(Player *p)
+static inline byte GetBestRailtype(const Player *p)
{
if (HasRailtypeAvail(p, RAILTYPE_MAGLEV)) return RAILTYPE_MAGLEV;
if (HasRailtypeAvail(p, RAILTYPE_MONO)) return RAILTYPE_MONO;