diff options
Diffstat (limited to 'src/town_type.h')
-rw-r--r-- | src/town_type.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/town_type.h b/src/town_type.h index 14d840cb0..39deb6167 100644 --- a/src/town_type.h +++ b/src/town_type.h @@ -107,4 +107,22 @@ typedef SimpleTinyEnumT<TownFounding, byte> TownFoundingByte; static const uint MAX_LENGTH_TOWN_NAME_CHARS = 32; ///< The maximum length of a town name in characters including '\0' +/** Store the maximum and actually transported cargo amount for the current and the last month. */ +template <typename Tstorage> +struct TransportedCargoStat { + Tstorage old_max; ///< Maximum amount last month + Tstorage new_max; ///< Maximum amount this month + Tstorage old_act; ///< Actually transported last month + Tstorage new_act; ///< Actually transported this month + + TransportedCargoStat() : old_max(0), new_max(0), old_act(0), new_act(0) {} + + /** Update stats for a new month. */ + void NewMonth() + { + this->old_max = this->new_max; this->new_max = 0; + this->old_act = this->new_act; this->new_act = 0; + } +}; + #endif /* TOWN_TYPE_H */ |