equal
deleted
inserted
replaced
78 |
78 |
79 uint16 GetDrawStringPlayerColor(PlayerID player); |
79 uint16 GetDrawStringPlayerColor(PlayerID player); |
80 |
80 |
81 void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player); |
81 void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player); |
82 void GetNameOfOwner(Owner owner, TileIndex tile); |
82 void GetNameOfOwner(Owner owner, TileIndex tile); |
83 Money CalculateCompanyValue(const Player* p); |
83 Money CalculateCompanyValue(const Player *p); |
84 void InvalidatePlayerWindows(const Player* p); |
84 void InvalidatePlayerWindows(const Player *p); |
85 void SetLocalPlayer(PlayerID new_player); |
85 void SetLocalPlayer(PlayerID new_player); |
86 #define FOR_ALL_PLAYERS(p) for (p = _players; p != endof(_players); p++) |
86 #define FOR_ALL_PLAYERS(p) for (p = _players; p != endof(_players); p++) |
87 |
87 |
88 VARDEF PlayerID _local_player; |
88 VARDEF PlayerID _local_player; |
89 VARDEF PlayerID _current_player; |
89 VARDEF PlayerID _current_player; |
102 } |
102 } |
103 |
103 |
104 return count; |
104 return count; |
105 } |
105 } |
106 |
106 |
107 static inline Player* GetPlayer(PlayerID i) |
107 static inline Player *GetPlayer(PlayerID i) |
108 { |
108 { |
109 assert(IS_INSIDE_1D(i, PLAYER_FIRST, lengthof(_players))); |
109 assert(IS_INSIDE_1D(i, PLAYER_FIRST, lengthof(_players))); |
110 return &_players[i]; |
110 return &_players[i]; |
111 } |
111 } |
112 |
112 |
148 * As the AI doesn't know what the BEST one is, we have our own priority list |
148 * As the AI doesn't know what the BEST one is, we have our own priority list |
149 * here. When adding new railtypes, modify this function |
149 * here. When adding new railtypes, modify this function |
150 * @param p the player "in action" |
150 * @param p the player "in action" |
151 * @return The "best" railtype a player has available |
151 * @return The "best" railtype a player has available |
152 */ |
152 */ |
153 static inline RailType GetBestRailtype(const Player* p) |
153 static inline RailType GetBestRailtype(const Player *p) |
154 { |
154 { |
155 if (HasRailtypeAvail(p, RAILTYPE_MAGLEV)) return RAILTYPE_MAGLEV; |
155 if (HasRailtypeAvail(p, RAILTYPE_MAGLEV)) return RAILTYPE_MAGLEV; |
156 if (HasRailtypeAvail(p, RAILTYPE_MONO)) return RAILTYPE_MONO; |
156 if (HasRailtypeAvail(p, RAILTYPE_MONO)) return RAILTYPE_MONO; |
157 if (HasRailtypeAvail(p, RAILTYPE_ELECTRIC)) return RAILTYPE_ELECTRIC; |
157 if (HasRailtypeAvail(p, RAILTYPE_ELECTRIC)) return RAILTYPE_ELECTRIC; |
158 return RAILTYPE_RAIL; |
158 return RAILTYPE_RAIL; |