1
/* $Id: player_base.h 12090 2008-02-09 02:49:33Z belugas $ */
3
/** @file player_base.h Definition of stuff that is very close to a player, like the player struct itself. */
10
#include "date_type.h"
13
#include "autoreplace_type.h"
14
#include "economy_type.h"
15
#include "tile_type.h"
17
struct PlayerEconomyEntry {
20
int32 delivered_cargo;
21
int32 performance_history; ///< player score (scale 0-1000)
30
uint16 president_name_1;
31
uint32 president_name_2;
40
Livery livery[LS_END];
41
byte player_money_fraction;
42
RailTypes avail_railtypes;
43
RoadTypes avail_roadtypes;
47
uint16 cargo_types; ///< which cargo types were transported the last year
49
TileIndex location_of_house;
50
TileIndex last_build_coordinate;
52
PlayerByte share_owners[4];
54
Year inaugurated_year;
55
byte num_valid_stat_ent;
57
byte quarters_of_bankrupcy;
58
byte bankrupt_asked; ///< which players were asked about buying it?
59
int16 bankrupt_timeout;
65
Money yearly_expenses[3][EXPENSES_END];
66
PlayerEconomyEntry cur_economy;
67
PlayerEconomyEntry old_economy[24];
68
EngineRenewList engine_renew_list; ///< Defined later
70
bool renew_keep_length;
71
int16 engine_renew_months;
72
uint32 engine_renew_money;
73
uint16 num_engines[TOTAL_NUM_ENGINES]; ///< caches the number of engines of each type the player owns (no need to save this)
76
extern Player _players[MAX_PLAYERS];
77
#define FOR_ALL_PLAYERS(p) for (p = _players; p != endof(_players); p++)
79
static inline byte ActivePlayerCount()
85
if (p->is_active) count++;
91
static inline Player *GetPlayer(PlayerID i)
93
assert(IsInsideBS(i, PLAYER_FIRST, lengthof(_players)));
97
Money CalculateCompanyValue(const Player *p);
99
#endif /* PLAYER_BASE_H */