|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
31 return (StationID)t.
m2();
353 SB(t.
m6(), 0, 1, b ? 1 : 0);
377 SB(t.
m6(), 6, 1, b ? 1 : 0);
401 SB(t.
m6(), 7, 1, b ? 1 : 0);
481 SB(t.
m6(), 2, 1, b ? 1 : 0);
564 return GB(t.
m8(), 0, 6) != 0;
576 SB(t.
m8(), 0, 6, specindex);
588 return GB(t.
m8(), 0, 6);
600 SB(t.
m3(), 4, 4, random_bits);
612 return GB(t.
m3(), 4, 4);
635 SB(t.
m6(), 3, 3, st);
667 MakeStation(t, o, sid, STATION_WAYPOINT, section + a);
720 MakeStation(t, o, sid, STATION_AIRPORT, section, wc);
void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, byte section, RailType rt)
Make the given tile a rail waypoint tile.
@ TRACK_BIT_NONE
No track.
byte StationGfx
Copy from station_map.h.
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.
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.
RoadStopType
Types of RoadStops.
@ ROADSTOP_TRUCK
A standard stop for trucks.
bool IsRailStation(Tile t)
Is this station tile a rail station?
bool IsBusStop(Tile t)
Is the station at t a bus stop?
Axis
Allow incrementing of DiagDirDiff variables.
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.
Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
debug_inline uint16_t & m8()
General purpose.
debug_inline byte & m6()
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?
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 byte & m5()
General purpose.
RailType GetRailType(Tile t)
Gets the rail type of the given tile.
Owner
Enum for all companies/owners.
debug_inline byte & m4()
General purpose.
void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, byte section, RailType rt)
Make the given tile a rail station tile.
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
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.
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?
StationType
Station types.
bool IsDock(Tile t)
Is tile t a dock tile?
bool IsTruckStop(Tile t)
Is the station at t a truck stop?
debug_inline byte & m7()
Primarily used for newgrf support.
void MakeAirport(Tile t, Owner o, StationID sid, byte section, WaterClass wc)
Make the given tile an airport tile.
StationGfx GetStationGfx(Tile t)
Get the station graphics of this tile.
void SetCustomStationSpecIndex(Tile t, byte specindex)
Set the custom station spec for this tile.
bool IsBayRoadStopTile(Tile t)
Is tile t a bay (non-drive through) road stop station?
RailType
Enumeration for all possible railtypes.
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
Track GetRailStationTrack(Tile t)
Get the rail track of a rail station tile.
byte StationGfx
Index of station graphics.
void SetStationGfx(Tile t, StationGfx gfx)
Set the station graphics of this tile.
byte GetStationTileRandomBits(Tile t)
Get the random bits of a station tile.
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?
void MakeDriveThroughRoadStop(Tile t, Owner station, Owner road, Owner tram, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, Axis a)
Make the given tile a drivethrough roadstop tile.
bool CanStationTileHavePylons(Tile t)
Can tile t have catenary pylons?
void SetWaterClass(Tile t, WaterClass wc)
Set the water class at a 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.
DiagDirection
Enumeration for diagonal directions.
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 SetStationTileRandomBits(Tile t, byte random_bits)
Set the random bits for a station tile.
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.
TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
void SetCustomRoadStopSpecIndex(Tile t, byte specindex)
Set the custom road stop spec for this tile.
@ ROADSTOP_BUS
A standard stop for buses.
bool IsBuoy(Tile t)
Is tile t a buoy tile?
bool IsCustomStationSpecIndex(Tile t)
Is there a custom rail station spec on this tile?
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.
@ OWNER_NONE
The tile has no ownership.
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.
bool IsRoadStop(Tile t)
Is the station at t a road station?
@ MP_STATION
A tile of a station.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
RoadType
The different roadtypes we support.
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.
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.
TrackBits
Allow incrementing of Track variables.
RoadStopType GetRoadStopType(Tile t)
Get the road stop type of this tile.
bool IsStationTileBlocked(Tile t)
Is tile t a blocked tile?
StationGfx GetTranslatedAirportTileID(StationGfx gfx)
Do airporttile gfx ID translation for NewGRFs.
void MakeStation(Tile t, Owner o, StationID sid, StationType st, byte section, WaterClass wc=WATER_CLASS_INVALID)
Make the given tile 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?
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?
Track
These are used to specify a single track.
bool IsRoadStopTile(Tile t)
Is tile t a road stop station?
debug_inline byte & m3()
General purpose.
bool CanStationTileHaveWires(Tile t)
Can tile t have catenary wires?
bool IsAirport(Tile t)
Is this station tile an airport?
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?
void MakeOilrig(Tile t, StationID sid, WaterClass wc)
Make the given tile an oilrig 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.