summaryrefslogtreecommitdiff
path: root/src/subsidy_base.h
diff options
context:
space:
mode:
authorTyler Trahan <tyler@tylertrahan.com>2021-04-22 13:54:32 -0400
committerMichael Lutz <michi@icosahedron.de>2021-06-10 23:26:16 +0200
commitd09210e1c6a446ec5a97de4e171aa101d047765a (patch)
treed45a31e2b65f3399888e14524b805b15ef94a90f /src/subsidy_base.h
parentc2db408d5d947cd4f3df42754a598226818c519f (diff)
downloadopenttd-d09210e1c6a446ec5a97de4e171aa101d047765a.tar.xz
Feature: Configurable subsidy duration
Diffstat (limited to 'src/subsidy_base.h')
-rw-r--r--src/subsidy_base.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/subsidy_base.h b/src/subsidy_base.h
index ef9276433..120c5cece 100644
--- a/src/subsidy_base.h
+++ b/src/subsidy_base.h
@@ -21,7 +21,7 @@ extern SubsidyPool _subsidy_pool;
/** Struct about subsidies, offered and awarded */
struct Subsidy : SubsidyPool::PoolItem<&_subsidy_pool> {
CargoID cargo_type; ///< Cargo type involved in this subsidy, CT_INVALID for invalid subsidy
- byte remaining; ///< Remaining months when this subsidy is valid
+ uint16 remaining; ///< Remaining months when this subsidy is valid
CompanyID awarded; ///< Subsidy is awarded to this company; INVALID_COMPANY if it's not awarded to anyone
SourceType src_type; ///< Source of subsidised path (ST_INDUSTRY or ST_TOWN)
SourceType dst_type; ///< Destination of subsidised path (ST_INDUSTRY or ST_TOWN)
@@ -52,11 +52,18 @@ struct Subsidy : SubsidyPool::PoolItem<&_subsidy_pool> {
/** Constants related to subsidies */
static const uint SUBSIDY_OFFER_MONTHS = 12; ///< Duration of subsidy offer
-static const uint SUBSIDY_CONTRACT_MONTHS = 12; ///< Duration of subsidy after awarding
static const uint SUBSIDY_PAX_MIN_POPULATION = 400; ///< Min. population of towns for subsidised pax route
static const uint SUBSIDY_CARGO_MIN_POPULATION = 900; ///< Min. population of destination town for cargo route
static const uint SUBSIDY_MAX_PCT_TRANSPORTED = 42; ///< Subsidy will be created only for towns/industries with less % transported
static const uint SUBSIDY_MAX_DISTANCE = 70; ///< Max. length of subsidised route (DistanceManhattan)
static const uint SUBSIDY_TOWN_CARGO_RADIUS = 6; ///< Extent of a tile area around town center when scanning for town cargo acceptance and production (6 ~= min catchmement + min station / 2)
+/** Types of subsidy news messages, which determine how the date is printed and whether to use singular or plural cargo names */
+enum class SubsidyDecodeParamType {
+ NewsOffered = 0, ///< News item for an offered subsidy
+ NewsAwarded = 1, ///< News item for an awarded subsidy
+ NewsWithdrawn = 2, ///< News item for a subsidy offer withdrawn, or expired subsidy
+ Gui = 3, ///< Subsidies listed in the Subsidy GUI
+};
+
#endif /* SUBSIDY_BASE_H */