(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

This commit is contained in:
rubidium
2011-01-18 21:30:59 +00:00
parent 6371b75bcc
commit b8c9988d9f
6 changed files with 135 additions and 3 deletions

View File

@@ -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.