190 void GetNameOfOwner(byte owner, uint tile); |
190 void GetNameOfOwner(byte owner, uint tile); |
191 int64 CalculateCompanyValue(Player *p); |
191 int64 CalculateCompanyValue(Player *p); |
192 void InvalidatePlayerWindows(Player *p); |
192 void InvalidatePlayerWindows(Player *p); |
193 void AiDoGameLoop(Player *p); |
193 void AiDoGameLoop(Player *p); |
194 void UpdatePlayerMoney32(Player *p); |
194 void UpdatePlayerMoney32(Player *p); |
195 #define DEREF_PLAYER(i) (&_players[i]) |
|
196 #define FOR_ALL_PLAYERS(p) for(p=_players; p != endof(_players); p++) |
195 #define FOR_ALL_PLAYERS(p) for(p=_players; p != endof(_players); p++) |
197 |
196 |
198 #define MAX_PLAYERS 8 |
197 #define MAX_PLAYERS 8 |
199 VARDEF Player _players[MAX_PLAYERS]; |
198 VARDEF Player _players[MAX_PLAYERS]; |
|
199 |
|
200 #define DEREF_PLAYER(i) (GetPlayer(i)) |
|
201 static inline Player* GetPlayer(uint i) |
|
202 { |
|
203 assert(i < lengthof(_players)); |
|
204 return &_players[i]; |
|
205 } |
200 |
206 |
201 #define IS_HUMAN_PLAYER(p) (!DEREF_PLAYER((byte)(p))->is_ai) |
207 #define IS_HUMAN_PLAYER(p) (!DEREF_PLAYER((byte)(p))->is_ai) |
202 #define IS_INTERACTIVE_PLAYER(p) (((byte)p) == _local_player) |
208 #define IS_INTERACTIVE_PLAYER(p) (((byte)p) == _local_player) |
203 |
209 |
204 typedef struct HighScore { |
210 typedef struct HighScore { |