|
OpenTTD Source 20260621-master-g720d10536d
|
All types related to tracks. More...
#include "core/enum_type.hpp"Go to the source code of this file.
Data Structures | |
| struct | TrackStatus |
| Track status of a tile. More... | |
Typedefs | |
| template<typename T> | |
| using | TrackIndexArray = EnumIndexArray<T, Track, Track::End> |
Array with Track as index. | |
| using | TrackBits = EnumBitSet<Track, uint8_t> |
Bitset of Track elements. | |
| template<typename T> | |
| using | TrackdirIndexArray = EnumIndexArray<T, Trackdir, Trackdir::End> |
Array with Trackdir as index. | |
| using | TrackdirBits = EnumBitSet<Trackdir, uint16_t> |
Bitset of Trackdir elements. | |
Enumerations | |
| enum class | Track : uint8_t { Begin = 0 , X = 0 , Y = 1 , Upper = 2 , Lower = 3 , Left = 4 , Right = 5 , End , Wormhole = 6 , Depot = 7 , Invalid = 0xFF } |
| These are used to specify a single track. More... | |
| enum class | Trackdir : uint8_t { X_NE = 0 , Y_SE = 1 , Upper_E = 2 , Lower_E = 3 , Left_S = 4 , Right_S = 5 , RvRev_NE = 6 , RvRev_SE = 7 , X_SW = 8 , Y_NW = 9 , Upper_W = 10 , Lower_W = 11 , Left_N = 12 , Right_N = 13 , RvRev_SW = 14 , RvRev_NW = 15 , End , Invalid = 0xFF } |
| Enumeration for tracks and directions. More... | |
Variables | |
| static constexpr TrackBits | TRACK_BIT_CROSS = {Track::X, Track::Y} |
| X-Y-axis cross. | |
| static constexpr TrackBits | TRACK_BIT_HORZ = {Track::Upper, Track::Lower} |
| Upper and lower track. | |
| static constexpr TrackBits | TRACK_BIT_VERT = {Track::Left, Track::Right} |
| Left and right track. | |
| static constexpr TrackBits | TRACK_BIT_3WAY_NE = {Track::X, Track::Upper, Track::Right} |
| "Arrow" to the north-east | |
| static constexpr TrackBits | TRACK_BIT_3WAY_SE = {Track::Y, Track::Lower, Track::Right} |
| "Arrow" to the south-east | |
| static constexpr TrackBits | TRACK_BIT_3WAY_SW = {Track::X, Track::Lower, Track::Left} |
| "Arrow" to the south-west | |
| static constexpr TrackBits | TRACK_BIT_3WAY_NW = {Track::Y, Track::Upper, Track::Left} |
| "Arrow" to the north-west | |
| static constexpr TrackBits | TRACK_BIT_ALL = {Track::X, Track::Y, Track::Upper, Track::Lower, Track::Left, Track::Right} |
| All possible tracks. | |
| static constexpr TrackdirBits | TRACKDIR_BIT_MASK |
| Bitset of valid non-road vehicle trackdirs/. | |
| static constexpr TrackdirBits | INVALID_TRACKDIR_BIT {UINT16_MAX} |
| Marker for an invalid TrackdirBits value. | |
All types related to tracks.
Definition in file track_type.h.
| using TrackBits = EnumBitSet<Track, uint8_t> |
Bitset of Track elements.
Definition at line 43 of file track_type.h.
| using TrackdirBits = EnumBitSet<Trackdir, uint16_t> |
Bitset of Trackdir elements.
Definition at line 93 of file track_type.h.
| using TrackdirIndexArray = EnumIndexArray<T, Trackdir, Trackdir::End> |
| T | the type contained within the array. |
Definition at line 90 of file track_type.h.
| using TrackIndexArray = EnumIndexArray<T, Track, Track::End> |
| T | the type contained within the array. |
Definition at line 40 of file track_type.h.
|
strong |
These are used to specify a single track.
Can be translated to a trackbit with TrackToTrackbit
| Enumerator | |
|---|---|
| Begin | Used for iterations. |
| X | Track along the x-axis (north-east to south-west). |
| Y | Track along the y-axis (north-west to south-east). |
| Upper | Track in the upper corner of the tile (north). |
| Lower | Track in the lower corner of the tile (south). |
| Left | Track in the left corner of the tile (west). |
| Right | Track in the right corner of the tile (east). |
| End | End marker (of regular track bits). |
| Wormhole | Special flag indicating vehicle is inside a bridge or tunnel. |
| Depot | Special flag indicating a vehicle is inside a depot. |
| Invalid | Flag for an invalid track. |
Definition at line 19 of file track_type.h.
|
strong |
Enumeration for tracks and directions.
These are a combination of tracks and directions. Values are 0-5 in one direction (corresponding to the Track enum) and 8-13 in the other direction. 6, 7, 14 and 15 are used to encode the reversing of road vehicles. Those reversing track dirs are not considered to be 'valid' except in a small corner in the road vehicle controller.
Definition at line 63 of file track_type.h.
|
staticconstexpr |
Marker for an invalid TrackdirBits value.
Definition at line 102 of file track_type.h.
Referenced by RemoveFirstTrackdir(), and ValueStr().
|
staticconstexpr |
"Arrow" to the north-east
Definition at line 48 of file track_type.h.
Referenced by DrawTile_Rail(), GetJunctionGroundSpriteOffset(), GetTileTrackStatus_Station(), and TileLoop_Rail().
|
staticconstexpr |
"Arrow" to the north-west
Definition at line 51 of file track_type.h.
Referenced by DrawTile_Rail(), GetJunctionGroundSpriteOffset(), and TileLoop_Rail().
|
staticconstexpr |
"Arrow" to the south-east
Definition at line 49 of file track_type.h.
Referenced by DrawTile_Rail(), GetJunctionGroundSpriteOffset(), and TileLoop_Rail().
|
staticconstexpr |
"Arrow" to the south-west
Definition at line 50 of file track_type.h.
Referenced by DrawTile_Rail(), GetJunctionGroundSpriteOffset(), and TileLoop_Rail().
|
staticconstexpr |
All possible tracks.
Definition at line 52 of file track_type.h.
Referenced by DisasterTick_Submarine(), GetTileTrackStatus_Station(), GetTileTrackStatus_Water(), MaskWireBits(), and TrackdirBitsToTrackBits().
X-Y-axis cross.
Definition at line 45 of file track_type.h.
Referenced by CmdRemoveSingleRail(), DrawTrackBits(), and MaskWireBits().
|
staticconstexpr |
Upper and lower track.
Definition at line 46 of file track_type.h.
Referenced by DrawTrackBits(), ExploreSegment(), GenericPlaceSignals(), GetRailFoundation(), and TracksOverlap().
|
staticconstexpr |
Left and right track.
Definition at line 47 of file track_type.h.
Referenced by DrawTrackBits(), ExploreSegment(), GenericPlaceSignals(), GetRailFoundation(), and TracksOverlap().
|
staticconstexpr |
Bitset of valid non-road vehicle trackdirs/.
Definition at line 96 of file track_type.h.
Referenced by IsValidTrackdir().