OpenTTD Source 20260621-master-g720d10536d
track_data.h File Reference

Data related to rail tracks. More...

Go to the source code of this file.

Variables

const DiagDirectionIndexArray< TrackdirBits_exitdir_reaches_trackdirs
 Maps a diagonal direction to the all trackdirs that are connected to any track entering in this direction (including those making 90 degree turns).
const TrackdirIndexArray< Trackdir_next_trackdir
 Next trackdir to use when moving to a new tile for each current trackdir.
const TrackIndexArray< TrackdirBits_track_crosses_trackdirs
 Maps a trackdir to all trackdirs that make 90 deg turns with it.
const TrackIndexArray< TrackBits_track_crosses_tracks
 Maps a track to all tracks that make 90 deg turns with it.
const TrackdirIndexArray< DiagDirection_trackdir_to_exitdir
 Maps a trackdir to the (4-way) direction the tile is exited when following that trackdir.
const TrackIndexArray< DiagDirectionIndexArray< Trackdir > > _track_exitdir_to_trackdir
 Maps a track and an (4-way) dir to the trackdir that represents the track with the exit in the given direction.
const TrackIndexArray< DiagDirectionIndexArray< Trackdir > > _track_enterdir_to_trackdir
 Maps a track and an (4-way) dir to the trackdir that represents the track with the entry in the given direction.
const TrackIndexArray< DirectionIndexArray< Trackdir > > _track_direction_to_trackdir
 Maps a track and a full (8-way) direction to the trackdir that represents the track running in the given direction.
const DiagDirectionIndexArray< Trackdir_dir_to_diag_trackdir
 Maps a (4-way) direction to the diagonal trackdir that runs in that direction.
const CornerIndexArray< TrackBits_corner_to_trackbits
 Maps a single horizontal/vertical trackbit that is in a specific tile corner.
const TrackdirBits _uphill_trackdirs []

Detailed Description

Data related to rail tracks.

Definition in file track_data.h.

Variable Documentation

◆ _corner_to_trackbits

const CornerIndexArray<TrackBits> _corner_to_trackbits
extern
Initial value:
{
}
@ Upper
Track in the upper corner of the tile (north).
Definition track_type.h:23
@ Right
Track in the right corner of the tile (east).
Definition track_type.h:26
@ Left
Track in the left corner of the tile (west).
Definition track_type.h:25
@ Lower
Track in the lower corner of the tile (south).
Definition track_type.h:24

Maps a single horizontal/vertical trackbit that is in a specific tile corner.

Referenced by CornerToTrackBits().

◆ _dir_to_diag_trackdir

const DiagDirectionIndexArray<Trackdir> _dir_to_diag_trackdir
extern
Initial value:
{
}
@ X_NE
X-axis and direction to north-east.
Definition track_type.h:64
@ X_SW
X-axis and direction to south-west.
Definition track_type.h:72
@ Y_SE
Y-axis and direction to south-east.
Definition track_type.h:65
@ Y_NW
Y-axis and direction to north-west.
Definition track_type.h:73

Maps a (4-way) direction to the diagonal trackdir that runs in that direction.

Referenced by DiagDirToDiagTrackdir().

◆ _exitdir_reaches_trackdirs

const DiagDirectionIndexArray<TrackdirBits> _exitdir_reaches_trackdirs
extern
Initial value:
{{{
}}}
@ Right_N
Right track and direction to north.
Definition track_type.h:77
@ Right_S
Right track and direction to south.
Definition track_type.h:69
@ Left_S
Left track and direction to south.
Definition track_type.h:68
@ Lower_E
Lower track and direction to east.
Definition track_type.h:67
@ Upper_W
Upper track and direction to west.
Definition track_type.h:74
@ Upper_E
Upper track and direction to east.
Definition track_type.h:66
@ Left_N
Left track and direction to north.
Definition track_type.h:76
@ Lower_W
Lower track and direction to west.
Definition track_type.h:75

Maps a diagonal direction to the all trackdirs that are connected to any track entering in this direction (including those making 90 degree turns).

Referenced by DiagdirReachesTrackdirs(), and TrackdirReachesTrackdirs().

◆ _next_trackdir

const TrackdirIndexArray<Trackdir> _next_trackdir
extern
Initial value:

Next trackdir to use when moving to a new tile for each current trackdir.

Referenced by NextTrackdir().

◆ _track_crosses_trackdirs

◆ _track_crosses_tracks

const TrackIndexArray<TrackBits> _track_crosses_tracks
extern
Initial value:
{
}
@ X
Track along the x-axis (north-east to south-west).
Definition track_type.h:21
@ Y
Track along the y-axis (north-west to south-east).
Definition track_type.h:22

Maps a track to all tracks that make 90 deg turns with it.

Referenced by TrackCrossesTracks().

◆ _track_direction_to_trackdir

◆ _track_enterdir_to_trackdir

◆ _track_exitdir_to_trackdir

◆ _trackdir_to_exitdir

const TrackdirIndexArray<DiagDirection> _trackdir_to_exitdir
extern
Initial value:

Maps a trackdir to the (4-way) direction the tile is exited when following that trackdir.

Referenced by TrackdirToExitdir().