Go to the documentation of this file.
23 extern const byte _signal_along_trackdir[
TRACKDIR_END] = {
24 0x8, 0x8, 0x8, 0x2, 0x4, 0x1, 0, 0,
25 0x4, 0x4, 0x4, 0x1, 0x8, 0x2
30 extern const byte _signal_against_trackdir[
TRACKDIR_END] = {
31 0x4, 0x4, 0x4, 0x1, 0x8, 0x2, 0, 0,
32 0x8, 0x8, 0x8, 0x2, 0x4, 0x1
37 extern const byte _signal_on_track[] = {
38 0xC, 0xC, 0xC, 0x3, 0xC, 0x3
44 extern const TrackdirBits _exitdir_reaches_trackdirs[] = {
67 extern const TrackBits _track_crosses_tracks[] = {
110 extern const Trackdir _dir_to_diag_trackdir[] = {
114 extern const TrackBits _corner_to_trackbits[] = {
198 return (
Company::Get(company)->avail_railtypes & ~_railtypes_hidden_mask) != 0;
225 if (rti->
label == 0)
continue;
235 if ((rts & required) != required)
continue;
267 SetBit(rts, rvi->railtype);
296 SetBit(rts, rvi->railtype);
316 if (rti->
label == label)
return r;
319 if (allow_alternate_labels) {
RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date)
Add the rail types that are to be introduced at the given date.
uint32 TileIndex
The index/ID of a Tile.
static Pool::IterateWrapperFiltered< Engine, EngineTypeFilter > IterateType(VehicleType vt, size_t from=0)
Returns an iterable ensemble of all valid engines of the given type.
@ TRACKDIR_BIT_UPPER_W
Track upper, direction west.
static Titem * Get(size_t index)
Returns Titem with given index.
@ TRACKDIR_LOWER_E
Lower track and direction to east.
TrackdirBits
Enumeration of bitmasks for the TrackDirs.
@ TRACKDIR_RIGHT_S
Right track and direction to south.
byte landscape
the landscape we're currently in
@ TRANSPORT_RAIL
Transport by train.
@ DIAGDIR_END
Used for iterations.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
@ TRACKDIR_LOWER_W
Lower track and direction to west.
This struct contains all the info that is needed to draw and construct tracks.
Information about a vehicle.
#define MAX_DAY
The number of days till the last day.
@ TRACKDIR_UPPER_E
Upper track and direction to east.
@ RAILTYPES_NONE
No rail types.
Owner
Enum for all companies/owners.
@ MP_ROAD
A tile with road (or tram tracks)
@ TRACKDIR_Y_SE
Y-axis and direction to south-east.
static bool IsLevelCrossing(TileIndex t)
Return whether a tile is a level crossing.
@ TRACK_BIT_UPPER
Upper track.
GameCreationSettings game_creation
settings used during the creation of a game (map)
@ TRACK_BIT_RIGHT
Right track.
static bool IsInsideMM(const T x, const size_t min, const size_t max)
Checks if a value is in an interval.
@ TRACKDIR_LEFT_N
Left track and direction to north.
RailTypes introduction_required_railtypes
Bitmask of railtypes that are required for this railtype to be introduced at a given introduction_dat...
static const RailtypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
bool ValParamRailtype(const RailType rail)
Validate functions for rail building.
@ TRACK_BIT_VERT
Left and right track.
Information about a rail vehicle.
@ TRACKDIR_BIT_X_NE
Track x-axis, direction north-east.
RailType
Enumeration for all possible railtypes.
@ TRACKDIR_BIT_LOWER_E
Track lower, direction east.
Date _date
Current date in days (day counter)
static bool HasStationRail(TileIndex t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
RailTypeLabelList alternate_labels
Rail type labels this type provides in addition to the main label.
bool HasAnyRailtypesAvail(const CompanyID company)
Test if any buildable railtype is available for a company.
int32 Date
The type to store our dates in.
Date introduction_date
Introduction date.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
@ TRACK_BIT_X
X-axis track.
@ TRACKDIR_BIT_LOWER_W
Track lower, direction west.
@ TRACKDIR_BIT_Y_SE
Track y-axis, direction south-east.
@ TRACKDIR_BIT_LEFT_S
Track left, direction south.
@ TRACKDIR_BIT_RIGHT_S
Track right, direction south.
@ TRACKDIR_BIT_LEFT_N
Track left, direction north.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
@ INVALID_TRACKDIR
Flag for an invalid trackdir.
@ TRACKDIR_X_NE
X-axis and direction to north-east.
DiagDirection
Enumeration for diagonal directions.
@ TRACKDIR_UPPER_W
Upper track and direction to west.
@ TRACK_BIT_LOWER
Lower track.
@ RAILVEH_WAGON
simple wagon, not motorized
@ TRACK_END
Used for iterations.
@ TRACK_BIT_HORZ
Upper and lower track.
@ TRACKDIR_BIT_NONE
No track build.
CompanyID _current_company
Company currently doing an action.
RailTypes GetRailTypes(bool introduces)
Get list of rail types, regardless of company availability.
@ TRACK_BIT_LEFT
Left track.
@ DIR_END
Used to iterate.
@ TRACKDIR_BIT_Y_NW
Track y-axis, direction north-west.
@ RAILTYPE_END
Used for iterations.
@ TRACKDIR_Y_NW
Y-axis and direction to north-west.
RailTypes GetCompanyRailtypes(CompanyID company, bool introduces)
Get the rail types the given company can build.
static RailType GetRailType(TileIndex t)
Gets the rail type of the given tile.
@ MP_STATION
A tile of a station.
RailTypeLabel label
Unique 32 bit rail type identifier.
static const int DAYS_IN_YEAR
days per year
@ TRACKDIR_END
Used for iterations.
TrackBits
Bitfield corresponding to Track.
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
RailType GetTileRailType(TileIndex tile)
Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile.
@ TRACKDIR_BIT_X_SW
Track x-axis, direction south-west.
RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
Get the rail type for a given label.
@ TRACK_BIT_Y
Y-axis track.
Trackdir
Enumeration for tracks and directions.
byte climates
Climates supported by the engine.
static TileType GetTileType(TileIndex tile)
Get the tiletype of a given tile.
@ VEH_TRAIN
Train vehicle type.
@ TRACKDIR_LEFT_S
Left track and direction to south.
@ TRACKDIR_X_SW
X-axis and direction to south-west.
bool HasRailtypeAvail(const CompanyID company, const RailType railtype)
Finds out if a company has a certain buildable railtype available.
@ TRACKDIR_BIT_RIGHT_N
Track right, direction north.
static TransportType GetTunnelBridgeTransportType(TileIndex t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
@ DIAGDIR_NE
Northeast, upper right on your monitor.
RailTypes
The different railtypes we support, but then a bitmask of them.
@ TRACKDIR_RIGHT_N
Right track and direction to north.
@ TRACKDIR_BIT_UPPER_E
Track upper, direction east.
@ INVALID_RAILTYPE
Flag for invalid railtype.
RailTypes introduces_railtypes
Bitmask of which other railtypes are introduced when this railtype is introduced.
@ RAILTYPE_BEGIN
Used for iterations.