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