From b8c9988d9fce02a3bfb958b0ebc7cf39961ef10c Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 18 Jan 2011 21:30:59 +0000 Subject: (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 --- src/rail.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/rail.h') 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 { @@ -216,6 +217,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. */ @@ -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. -- cgit v1.2.3-54-g00ecf