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