OpenTTD Source
20240915-master-g3784a3d3d6
|
Go to the documentation of this file.
23 extern const uint8_t _signal_along_trackdir[
TRACKDIR_END] = {
24 0x8, 0x8, 0x8, 0x2, 0x4, 0x1, 0, 0,
25 0x4, 0x4, 0x4, 0x1, 0x8, 0x2
30 extern const uint8_t _signal_against_trackdir[
TRACKDIR_END] = {
31 0x4, 0x4, 0x4, 0x1, 0x8, 0x2, 0, 0,
32 0x8, 0x8, 0x8, 0x2, 0x4, 0x1
37 extern const uint8_t _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;
316 if (rti->
label == label)
return r;
319 if (allow_alternate_labels) {
@ INVALID_RAILTYPE
Flag for invalid railtype.
@ TRACKDIR_X_SW
X-axis and direction to south-west.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
TimerGameCalendar::Date introduction_date
Introduction date.
static Pool::IterateWrapperFiltered< Engine, EngineTypeFilter > IterateType(VehicleType vt, size_t from=0)
Returns an iterable ensemble of all valid engines of the given type.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
static Titem * Get(size_t index)
Returns Titem with given index.
bool ValParamRailType(const RailType rail)
Validate functions for rail building.
constexpr bool IsInsideMM(const T x, const size_t min, const size_t max) noexcept
Checks if a value is in an interval.
@ TRACK_BIT_X
X-axis track.
const RailTypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
bool HasAnyRailTypesAvail(const CompanyID company)
Test if any buildable railtype is available for a company.
@ TRACKDIR_LEFT_N
Left track and direction to north.
Owner
Enum for all companies/owners.
RailType
Enumeration for all possible railtypes.
@ TRACK_BIT_HORZ
Upper and lower track.
@ DIR_END
Used to iterate.
@ VEH_TRAIN
Train vehicle type.
bool HasRailTypeAvail(const CompanyID company, const RailType railtype)
Finds out if a company has a certain buildable railtype available.
This struct contains all the info that is needed to draw and construct tracks.
@ TRACKDIR_BIT_LEFT_N
Track left, direction north.
@ TRACKDIR_UPPER_W
Upper track and direction to west.
RailTypeLabelList alternate_labels
Rail type labels this type provides in addition to the main label.
@ TRACK_BIT_VERT
Left and right track.
DiagDirection
Enumeration for diagonal directions.
Wrapper class to abstract away the way the tiles are stored.
RailTypes introduction_required_railtypes
Bitmask of railtypes that are required for this railtype to be introduced at a given introduction_dat...
bool IsLevelCrossing(Tile t)
Return whether a tile is a level crossing.
@ RAILTYPE_END
Used for iterations.
Information about a vehicle.
@ TRACKDIR_BIT_Y_NW
Track y-axis, direction north-west.
RailType GetRailType(Tile t)
Gets the rail type of the given tile.
uint8_t landscape
the landscape we're currently in
RailTypes
Allow incrementing of Track variables.
@ MP_ROAD
A tile with road (or tram tracks)
@ TRACK_END
Used for iterations.
GameCreationSettings game_creation
settings used during the creation of a game (map)
static debug_inline TileType GetTileType(Tile tile)
Get the tiletype of a given tile.
static constexpr TimerGame< struct Calendar >::Date MAX_DATE
The date of the last day of the max year.
@ TRACKDIR_LEFT_S
Left track and direction to south.
Information about a rail vehicle.
TrackBits
Allow incrementing of Track variables.
@ TRACKDIR_Y_SE
Y-axis and direction to south-east.
@ RAILTYPE_BEGIN
Used for iterations.
RailTypes AddDateIntroducedRailTypes(RailTypes current, TimerGameCalendar::Date date)
Add the rail types that are to be introduced at the given date.
@ TRACKDIR_BIT_NONE
No track build.
@ TRACKDIR_UPPER_E
Upper track and direction to east.
@ TRACK_BIT_LEFT
Left track.
@ TRACKDIR_BIT_LOWER_W
Track lower, direction west.
@ TRACKDIR_LOWER_W
Lower track and direction to west.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
@ TRACKDIR_BIT_UPPER_E
Track upper, direction east.
RailTypeLabel label
Unique 32 bit rail type identifier.
uint8_t climates
Climates supported by the engine.
@ TRACKDIR_BIT_LEFT_S
Track left, direction south.
@ TRACKDIR_BIT_RIGHT_S
Track right, direction south.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
@ TRACKDIR_RIGHT_N
Right track and direction to north.
@ RAILVEH_WAGON
simple wagon, not motorized
@ TRACKDIR_Y_NW
Y-axis and direction to north-west.
@ TRACK_BIT_UPPER
Upper track.
@ TRACKDIR_BIT_X_NE
Track x-axis, direction north-east.
@ TRACKDIR_RIGHT_S
Right track and direction to south.
CompanyID _current_company
Company currently doing an action.
RailTypes GetRailTypes(bool introduces)
Get list of rail types, regardless of company availability.
@ TRACK_BIT_RIGHT
Right track.
RailTypes GetCompanyRailTypes(CompanyID company, bool introduces)
Get the rail types the given company can build.
Trackdir
Enumeration for tracks and directions.
@ TRANSPORT_RAIL
Transport by train.
@ TRACKDIR_X_NE
X-axis and direction to north-east.
@ TRACKDIR_BIT_LOWER_E
Track lower, direction east.
bool HasStationRail(Tile t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
RailType GetTileRailType(Tile tile)
Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile.
@ MP_STATION
A tile of a station.
TransportType GetTunnelBridgeTransportType(Tile t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
@ DIAGDIR_END
Used for iterations.
RailType railtype
Railtype, mangled if elrail is disabled.
@ TRACK_BIT_Y
Y-axis track.
@ TRACKDIR_END
Used for iterations.
RailTypes introduces_railtypes
Bitmask of which other railtypes are introduced when this railtype is introduced.
@ TRACKDIR_BIT_Y_SE
Track y-axis, direction south-east.
@ TRACKDIR_BIT_RIGHT_N
Track right, direction north.
@ TRACK_BIT_LOWER
Lower track.
@ TRACKDIR_LOWER_E
Lower track and direction to east.
RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
Get the rail type for a given label.
static Date date
Current date in days (day counter).
TrackdirBits
Allow incrementing of Trackdir variables.
static constexpr int DAYS_IN_YEAR
days per year
@ INVALID_TRACKDIR
Flag for an invalid trackdir.
@ TRACKDIR_BIT_UPPER_W
Track upper, direction west.
@ TRACKDIR_BIT_X_SW
Track x-axis, direction south-west.
@ RAILTYPES_NONE
No rail types.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.