OpenTTD Source
20240915-master-g3784a3d3d6
|
Go to the documentation of this file.
31 return (StationID)t.
m2();
302 SB(tile.
m3(), 2, 2, s);
650 return GB(t.
m8(), 0, 6) != 0;
662 SB(t.
m8(), 0, 6, specindex);
674 return GB(t.
m8(), 0, 6);
686 SB(t.
m3(), 4, 4, random_bits);
698 return GB(t.
m3(), 4, 4);
721 SB(t.
m6(), 3, 4, st);
753 MakeStation(t, o, sid, STATION_WAYPOINT, section + a);
806 MakeStation(t, o, sid, STATION_AIRPORT, section, wc);
@ ROADSTOP_BUS
A standard stop for buses.
void MakeStation(Tile t, Owner o, StationID sid, StationType st, uint8_t section, WaterClass wc=WATER_CLASS_INVALID)
Make the given tile a station tile.
uint8_t StationGfx
Index of station graphics.
debug_inline uint8_t & m5()
General purpose.
void MakeRoadStop(Tile t, Owner o, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, DiagDirection d)
Make the given tile a roadstop tile.
void MakeBuoy(Tile t, StationID sid, WaterClass wc)
Make the given tile a buoy tile.
static bool IsRoadWaypointOnSnowOrDesert(Tile t)
Check if a road waypoint tile has snow/desert.
void SetRoadTypes(Tile t, RoadType road_rt, RoadType tram_rt)
Set the present road types of a tile.
TrackBits GetStationReservationTrackBits(Tile t)
Get the reserved track bits for a waypoint.
debug_inline uint8_t & m3()
General purpose.
void SetCustomRoadStopSpecIndex(Tile t, uint8_t specindex)
Set the custom road stop spec for this tile.
bool IsRailStation(Tile t)
Is this station tile a rail station?
bool IsBusStop(Tile t)
Is the station at t a bus stop?
static Roadside GetRoadWaypointRoadside(Tile tile)
Get the decorations of a road waypoint.
bool IsHangar(Tile t)
Check whether the given tile is a hangar.
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
Owner
Enum for all companies/owners.
RailType
Enumeration for all possible railtypes.
Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
debug_inline uint16_t & m8()
General purpose.
bool IsOilRig(Tile t)
Is tile t part of an oilrig?
void SetStationTileHaveWires(Tile t, bool b)
Set the catenary wires state of the rail station.
void SetStationTileHavePylons(Tile t, bool b)
Set the catenary pylon state of the rail station.
bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
Check if a tile is a valid continuation to a railstation tile.
bool IsRailStationTile(Tile t)
Is this tile a station tile and a rail station?
DiagDirection
Enumeration for diagonal directions.
Wrapper class to abstract away the way the tiles are stored.
DiagDirection GetRoadStopDir(Tile t)
Gets the direction the road stop entrance points towards.
DiagDirection GetDockDirection(Tile t)
Get the direction of a dock.
debug_inline uint8_t & m4()
General purpose.
RailType GetRailType(Tile t)
Gets the rail type of the given tile.
debug_inline uint8_t & m7()
Primarily used for newgrf support.
bool IsRailWaypointTile(Tile t)
Is this tile a station tile and a rail waypoint?
Axis GetRailStationAxis(Tile t)
Get the rail direction of a rail station.
@ ROADSTOP_TRUCK
A standard stop for trucks.
StationType
Station types.
TrackBits GetRailStationTrackBits(Tile t)
Get the trackbits of a rail station tile.
bool IsCustomRoadStopSpecIndex(Tile t)
Is there a custom road stop spec on this tile?
@ TRACK_BIT_NONE
No track.
bool IsDock(Tile t)
Is tile t a dock tile?
bool IsTruckStop(Tile t)
Is the station at t a truck stop?
void MakeDriveThroughRoadStop(Tile t, Owner station, Owner road, Owner tram, StationID sid, StationType rst, RoadType road_rt, RoadType tram_rt, Axis a)
Make the given tile a drivethrough roadstop tile.
StationGfx GetStationGfx(Tile t)
Get the station graphics of this tile.
bool IsBayRoadStopTile(Tile t)
Is tile t a bay (non-drive through) road stop station?
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
Track GetRailStationTrack(Tile t)
Get the rail track of a rail station tile.
void SetStationGfx(Tile t, StationGfx gfx)
Set the station graphics of this tile.
uint8_t StationGfx
Copy from station_map.h.
@ OWNER_NONE
The tile has no ownership.
TrackBits
Allow incrementing of Track variables.
Roadside
The possible road side decorations.
uint8_t GetStationTileRandomBits(Tile t)
Get the random bits of a station tile.
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
bool HasStationTileRail(Tile t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
bool IsBuoyTile(Tile t)
Is tile t a buoy tile?
RoadType
The different roadtypes we support.
bool CanStationTileHavePylons(Tile t)
Can tile t have catenary pylons?
void SetWaterClass(Tile t, WaterClass wc)
Set the water class at a tile.
void SetCustomStationSpecIndex(Tile t, uint8_t specindex)
Set the custom station spec for this tile.
bool IsCompatibleRail(RailType enginetype, RailType tiletype)
Checks if an engine of the given RailType can drive on a tile with a given RailType.
Owner GetTileOwner(Tile tile)
Returns the owner of a tile.
debug_inline uint8_t & m6()
General purpose.
static void ToggleRoadWaypointOnSnowOrDesert(Tile t)
Toggle the snow/desert state of a road waypoint tile.
static const int GFX_DOCK_BASE_WATER_PART
The offset for the water parts.
uint GetCustomRoadStopSpecIndex(Tile t)
Get the custom road stop spec for this tile.
void SetRailStationReservation(Tile t, bool b)
Set the reservation state of the rail station.
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
void SetStationTileBlocked(Tile t, bool b)
Set the blocked state of the rail station.
static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET
The offset for the drive through parts.
StationType GetStationType(Tile t)
Get the station type of this tile.
bool IsStationRoadStopTile(Tile t)
Is tile t a road stop station?
TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
bool IsRoadWaypoint(Tile t)
Is the station at t a road waypoint?
constexpr T AssignBit(T &x, const uint8_t y, bool value)
Assigns a bit in a variable.
Track
These are used to specify a single track.
bool IsBuoy(Tile t)
Is tile t a buoy tile?
bool IsCustomStationSpecIndex(Tile t)
Is there a custom rail station spec on this tile?
void MakeAirport(Tile t, Owner o, StationID sid, uint8_t section, WaterClass wc)
Make the given tile an airport tile.
Axis
Allow incrementing of DiagDirDiff variables.
bool IsRoadWaypointTile(Tile t)
Is this tile a station tile and a road waypoint?
StationID GetStationIndex(Tile t)
Get StationID from a tile.
bool HasStationReservation(Tile t)
Get the reservation state of the rail station.
bool HasStationRail(Tile t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
StationGfx GetAirportGfx(Tile t)
Get the station graphics of this airport tile.
void SetDockingTile(Tile t, bool b)
Set the docking tile state of a tile.
void SetRailType(Tile t, RailType r)
Sets the rail type of the given tile.
void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
Make the given tile a rail waypoint tile.
@ MP_STATION
A tile of a station.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a Tile.
void SetRoadOwner(Tile t, RoadTramType rtt, Owner o)
Set the owner of a specific road type.
static void SetRoadWaypointRoadside(Tile tile, Roadside s)
Set the decorations of a road waypoint.
Track AxisToTrack(Axis a)
Convert an Axis to the corresponding Track AXIS_X -> TRACK_X AXIS_Y -> TRACK_Y Uses the fact that the...
bool IsDockWaterPart(Tile t)
Check whether a dock tile is the tile on water.
RoadStopType GetRoadStopType(Tile t)
Get the road stop type of this tile.
bool IsStationTileBlocked(Tile t)
Is tile t a blocked tile?
RoadStopType
Types of RoadStops.
StationGfx GetTranslatedAirportTileID(StationGfx gfx)
Do airporttile gfx ID translation for NewGRFs.
bool IsStationRoadStop(Tile t)
Is the station at t a road station?
void SetStationTileRandomBits(Tile t, uint8_t random_bits)
Set the random bits for a station tile.
TrackBits AxisToTrackBits(Axis a)
Maps an Axis to the corresponding TrackBits value.
constexpr T SB(T &x, const uint8_t s, const uint8_t n, const U d)
Set n bits in x starting at bit s to d.
bool IsAirportTile(Tile t)
Is this tile a station tile and an airport tile?
bool IsDockTile(Tile t)
Is tile t a dock tile?
bool IsAnyRoadStop(Tile t)
Is the station at t a road station?
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
bool IsRailWaypoint(Tile t)
Is this station tile a rail waypoint?
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
bool IsAnyRoadStopTile(Tile t)
Is tile t a road stop station?
bool CanStationTileHaveWires(Tile t)
Can tile t have catenary wires?
bool IsAirport(Tile t)
Is this station tile an airport?
constexpr T ToggleBit(T &x, const uint8_t y)
Toggles a bit in a variable.
void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
Make the given tile a dock tile.
bool IsDriveThroughStopTile(Tile t)
Is tile t a drive through road stop station or waypoint?
void MakeOilrig(Tile t, StationID sid, WaterClass wc)
Make the given tile an oilrig tile.
void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
Make the given tile a rail station tile.
bool IsHangarTile(Tile t)
Is tile t an hangar tile?
uint GetCustomStationSpecIndex(Tile t)
Get the custom station spec for this tile.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.