summaryrefslogtreecommitdiff
path: root/src/rail.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-18 21:30:59 +0000
committerrubidium <rubidium@openttd.org>2011-01-18 21:30:59 +0000
commitb8c9988d9fce02a3bfb958b0ebc7cf39961ef10c (patch)
tree6ace877720369defc6a552ea53b731d8bd42c982 /src/rail.h
parent6371b75bcc0789d4895e5c157237cbeaf332a99a (diff)
downloadopenttd-b8c9988d9fce02a3bfb958b0ebc7cf39961ef10c.tar.xz
(svn r21842) -Feature [FS#4393]: [NewGRF] Introduction dates/required types for rail types; e.g. introduce a particular rail type in 1960 (or when a vehicle using it is introduced), but also allow limiting its introduction to only happen when the required railtypes are available
Diffstat (limited to 'src/rail.h')
-rw-r--r--src/rail.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rail.h b/src/rail.h
index 81bac120c..46df36803 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -19,6 +19,7 @@
#include "economy_func.h"
#include "slope_type.h"
#include "strings_type.h"
+#include "date_type.h"
/** Railtype flags. */
enum RailTypeFlags {
@@ -217,6 +218,21 @@ struct RailtypeInfo {
byte map_colour;
/**
+ * Introduction date.
+ * When #INVALID_DATE or a vehicle using this railtype gets introduced earlier,
+ * the vehicle's introduction date will be used instead for this railtype.
+ * The introduction at this date is furthermore limited by the
+ * #introduction_required_types.
+ */
+ Date introduction_date;
+
+ /**
+ * Bitmask of railtypes that are required for this railtype to be introduced
+ * at a given #introduction_date.
+ */
+ RailTypes introduction_required_railtypes;
+
+ /**
* Bitmask of which other railtypes are introduced when this railtype is introduced.
*/
RailTypes introduces_railtypes;
@@ -368,6 +384,8 @@ bool ValParamRailtype(const RailType rail);
*/
RailType GetBestRailtype(const CompanyID company);
+RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date);
+
/**
* Get the rail types the given company can build.
* @param c the company to get the rail types for.