diff options
author | frosch <frosch@openttd.org> | 2011-10-03 17:25:44 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-10-03 17:25:44 +0000 |
commit | 23a2f23eb35cec39f7a31fe6b541c95a11e0102f (patch) | |
tree | 0e25194fcb6683e3b9355a26d6fc85cd3c063a5a /src/group.h | |
parent | d6e6e8a9d4d4e6937fc030a7d5d5a0e38cf6f991 (diff) | |
download | openttd-23a2f23eb35cec39f7a31fe6b541c95a11e0102f.tar.xz |
(svn r22984) -Feature: Display profit icons for groups in the group GUI.
Diffstat (limited to 'src/group.h')
-rw-r--r-- | src/group.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/group.h b/src/group.h index 557fdfbde..cfc1dd578 100644 --- a/src/group.h +++ b/src/group.h @@ -26,18 +26,29 @@ struct GroupStatistics { uint16 num_vehicle; ///< Number of vehicles. uint16 *num_engines; ///< Caches the number of engines of each type the company owns. + uint16 num_profit_vehicle; ///< Number of vehicles considered for profit statistics; + Money profit_last_year; ///< Sum of profits for all vehicles. + GroupStatistics(); ~GroupStatistics(); void Clear(); + void ClearProfits() + { + this->num_profit_vehicle = 0; + this->profit_last_year = 0; + } + static GroupStatistics &Get(CompanyID company, GroupID id_g, VehicleType type); static GroupStatistics &Get(const Vehicle *v); static GroupStatistics &GetAllGroup(const Vehicle *v); static void CountVehicle(const Vehicle *v, int delta); static void CountEngine(const Vehicle *v, int delta); + static void VehicleReachedProfitAge(const Vehicle *v); + static void UpdateProfits(); static void UpdateAfterLoad(); }; |