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) {
static TileType GetTileType(TileIndex tile)
Get the tiletype of a given tile.
Owner
Enum for all companies/owners.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition of stuff that is very close to a company, like the company struct itself.
static const RailtypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
static const int DAYS_IN_YEAR
days per year
TrackdirBits
Enumeration of bitmasks for the TrackDirs.
static TransportType GetTunnelBridgeTransportType(TileIndex t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
Track upper, direction west.
byte landscape
the landscape we're currently in
Maps accessors for stations.
Lower track and direction to west.
static Titem * Get(size_t index)
Returns Titem with given index.
Functions related to dates.
X-axis and direction to north-east.
RailTypes introduction_required_railtypes
Bitmask of railtypes that are required for this railtype to be introduced at a given introduction_dat...
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
Trackdir
Enumeration for tracks and directions.
A tile with road (or tram tracks)
Flag for invalid railtype.
bool ValParamRailtype(const RailType rail)
Validate functions for rail building.
RailTypeLabelList alternate_labels
Rail type labels this type provides in addition to the main label.
Upper track and direction to west.
static bool IsLevelCrossing(TileIndex t)
Return whether a tile is a level crossing.
This struct contains all the info that is needed to draw and construct tracks.
static bool HasStationRail(TileIndex t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint...
static bool IsInsideMM(const T x, const size_t min, const size_t max)
Checks if a value is in an interval.
Y-axis and direction to north-west.
Information about a vehicle.
Y-axis and direction to south-east.
Right track and direction to south.
Track right, direction north.
simple wagon, not motorized
Track left, direction south.
Definition of base types and functions in a cross-platform compatible way.
Track y-axis, direction south-east.
A number of safeguards to prevent using unsafe methods.
Flag for an invalid trackdir.
RailTypes introduces_railtypes
Bitmask of which other railtypes are introduced when this railtype is introduced. ...
RailTypes GetRailTypes(bool introduces)
Get list of rail types, regardless of company availability.
bool HasAnyRailtypesAvail(const CompanyID company)
Test if any buildable railtype is available for a company.
TrackBits
Bitfield corresponding to Track.
Left track and direction to south.
Track left, direction north.
RailTypeLabel label
Unique 32 bit rail type identifier.
RailTypes
The different railtypes we support, but then a bitmask of them.
Upper track and direction to east.
Information about a rail vehicle.
Functions related to companies.
RailType GetTileRailType(TileIndex tile)
Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile.
Date introduction_date
Introduction date.
RailType
Enumeration for all possible railtypes.
Track lower, direction east.
Tunnel entry/exit and bridge heads.
uint32 TileIndex
The index/ID of a Tile.
bool HasRailtypeAvail(const CompanyID company, const RailType railtype)
Finds out if a company has a certain buildable railtype available.
#define MAX_DAY
The number of days till the last day.
Track x-axis, direction south-west.
Track y-axis, direction north-west.
CompanyID _current_company
Company currently doing an action.
X-axis and direction to south-west.
Functions that have tunnels and bridges in common.
int32 Date
The type to store our dates in.
Track lower, direction west.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
DiagDirection
Enumeration for diagonal directions.
Track upper, direction east.
Northeast, upper right on your monitor.
GameCreationSettings game_creation
settings used during the creation of a game (map)
RailTypes GetCompanyRailtypes(CompanyID company, bool introduces)
Get the rail types the given company can build.
Track x-axis, direction north-east.
Left track and direction to north.
RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
Get the rail type for a given label.
Right track and direction to north.
byte climates
Climates supported by the engine.
Date _date
Current date in days (day counter)
RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date)
Add the rail types that are to be introduced at the given date.
Lower track and direction to east.
static RailType GetRailType(TileIndex t)
Gets the rail type of the given tile.
Track right, direction south.
static Pool::IterateWrapper< Engine > IterateType(VehicleType vt, size_t from=0)
Returns an iterable ensemble of all valid engines of the given type.