OpenTTD Source  14.0-beta3
station_map.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef STATION_MAP_H
11 #define STATION_MAP_H
12 
13 #include "rail_map.h"
14 #include "road_map.h"
15 #include "water_map.h"
16 #include "station_func.h"
17 #include "rail.h"
18 #include "road.h"
19 
20 typedef byte StationGfx;
21 
28 inline StationID GetStationIndex(Tile t)
29 {
30  assert(IsTileType(t, MP_STATION));
31  return (StationID)t.m2();
32 }
33 
34 
35 static const int GFX_DOCK_BASE_WATER_PART = 4;
36 static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET = 4;
37 
45 {
46  assert(IsTileType(t, MP_STATION));
47  return (StationType)GB(t.m6(), 3, 3);
48 }
49 
57 {
58  assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS);
59  return GetStationType(t) == STATION_TRUCK ? ROADSTOP_TRUCK : ROADSTOP_BUS;
60 }
61 
69 {
70  assert(IsTileType(t, MP_STATION));
71  return t.m5();
72 }
73 
80 inline void SetStationGfx(Tile t, StationGfx gfx)
81 {
82  assert(IsTileType(t, MP_STATION));
83  t.m5() = gfx;
84 }
85 
92 inline bool IsRailStation(Tile t)
93 {
94  return GetStationType(t) == STATION_RAIL;
95 }
96 
102 inline bool IsRailStationTile(Tile t)
103 {
104  return IsTileType(t, MP_STATION) && IsRailStation(t);
105 }
106 
113 inline bool IsRailWaypoint(Tile t)
114 {
115  return GetStationType(t) == STATION_WAYPOINT;
116 }
117 
123 inline bool IsRailWaypointTile(Tile t)
124 {
125  return IsTileType(t, MP_STATION) && IsRailWaypoint(t);
126 }
127 
135 inline bool HasStationRail(Tile t)
136 {
137  return IsRailStation(t) || IsRailWaypoint(t);
138 }
139 
146 inline bool HasStationTileRail(Tile t)
147 {
148  return IsTileType(t, MP_STATION) && HasStationRail(t);
149 }
150 
157 inline bool IsAirport(Tile t)
158 {
159  return GetStationType(t) == STATION_AIRPORT;
160 }
161 
167 inline bool IsAirportTile(Tile t)
168 {
169  return IsTileType(t, MP_STATION) && IsAirport(t);
170 }
171 
172 bool IsHangar(Tile t);
173 
180 inline bool IsTruckStop(Tile t)
181 {
182  return GetStationType(t) == STATION_TRUCK;
183 }
184 
191 inline bool IsBusStop(Tile t)
192 {
193  return GetStationType(t) == STATION_BUS;
194 }
195 
202 inline bool IsRoadStop(Tile t)
203 {
204  assert(IsTileType(t, MP_STATION));
205  return IsTruckStop(t) || IsBusStop(t);
206 }
207 
213 inline bool IsRoadStopTile(Tile t)
214 {
215  return IsTileType(t, MP_STATION) && IsRoadStop(t);
216 }
217 
223 inline bool IsBayRoadStopTile(Tile t)
224 {
226 }
227 
234 {
236 }
237 
239 
247 {
248  assert(IsAirport(t));
250 }
251 
259 {
260  StationGfx gfx = GetStationGfx(t);
261  assert(IsRoadStopTile(t));
263  return (DiagDirection)(gfx);
264  } else {
266  }
267 }
268 
275 inline bool IsOilRig(Tile t)
276 {
277  return GetStationType(t) == STATION_OILRIG;
278 }
279 
286 inline bool IsDock(Tile t)
287 {
288  return GetStationType(t) == STATION_DOCK;
289 }
290 
296 inline bool IsDockTile(Tile t)
297 {
298  return IsTileType(t, MP_STATION) && GetStationType(t) == STATION_DOCK;
299 }
300 
307 inline bool IsBuoy(Tile t)
308 {
309  return GetStationType(t) == STATION_BUOY;
310 }
311 
317 inline bool IsBuoyTile(Tile t)
318 {
319  return IsTileType(t, MP_STATION) && IsBuoy(t);
320 }
321 
327 inline bool IsHangarTile(Tile t)
328 {
329  return IsTileType(t, MP_STATION) && IsHangar(t);
330 }
331 
339 {
340  assert(HasStationRail(t));
341  return HasBit(t.m6(), 0);
342 }
343 
350 inline void SetStationTileBlocked(Tile t, bool b)
351 {
352  assert(HasStationRail(t));
353  SB(t.m6(), 0, 1, b ? 1 : 0);
354 }
355 
363 {
364  assert(HasStationRail(t));
365  return HasBit(t.m6(), 6);
366 }
367 
374 inline void SetStationTileHaveWires(Tile t, bool b)
375 {
376  assert(HasStationRail(t));
377  SB(t.m6(), 6, 1, b ? 1 : 0);
378 }
379 
387 {
388  assert(HasStationRail(t));
389  return HasBit(t.m6(), 7);
390 }
391 
398 inline void SetStationTileHavePylons(Tile t, bool b)
399 {
400  assert(HasStationRail(t));
401  SB(t.m6(), 7, 1, b ? 1 : 0);
402 }
403 
411 {
412  assert(HasStationRail(t));
413  return HasBit(GetStationGfx(t), 0) ? AXIS_Y : AXIS_X;
414 }
415 
423 {
424  return AxisToTrack(GetRailStationAxis(t));
425 }
426 
434 {
436 }
437 
451 inline bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
452 {
453  assert(IsRailStationTile(station_tile));
454  return IsRailStationTile(test_tile) && !IsStationTileBlocked(test_tile) &&
455  IsCompatibleRail(GetRailType(test_tile), GetRailType(station_tile)) &&
456  GetRailStationAxis(test_tile) == GetRailStationAxis(station_tile) &&
457  GetStationIndex(test_tile) == GetStationIndex(station_tile);
458 }
459 
467 {
468  assert(HasStationRail(t));
469  return HasBit(t.m6(), 2);
470 }
471 
478 inline void SetRailStationReservation(Tile t, bool b)
479 {
480  assert(HasStationRail(t));
481  SB(t.m6(), 2, 1, b ? 1 : 0);
482 }
483 
491 {
493 }
494 
503 {
504  StationGfx gfx = GetStationGfx(t);
505  assert(IsDock(t) && gfx < GFX_DOCK_BASE_WATER_PART);
506  return (DiagDirection)(gfx);
507 }
508 
512 inline bool IsDockWaterPart(Tile t)
513 {
514  assert(IsDockTile(t));
515  StationGfx gfx = GetStationGfx(t);
516  return gfx >= GFX_DOCK_BASE_WATER_PART;
517 }
518 
526 {
527  assert(HasStationTileRail(t));
528  return t.m4() != 0;
529 }
530 
537 inline void SetCustomStationSpecIndex(Tile t, byte specindex)
538 {
539  assert(HasStationTileRail(t));
540  t.m4() = specindex;
541 }
542 
550 {
551  assert(HasStationTileRail(t));
552  return t.m4();
553 }
554 
562 {
563  assert(IsRoadStopTile(t));
564  return GB(t.m8(), 0, 6) != 0;
565 }
566 
573 inline void SetCustomRoadStopSpecIndex(Tile t, byte specindex)
574 {
575  assert(IsRoadStopTile(t));
576  SB(t.m8(), 0, 6, specindex);
577 }
578 
586 {
587  assert(IsRoadStopTile(t));
588  return GB(t.m8(), 0, 6);
589 }
590 
597 inline void SetStationTileRandomBits(Tile t, byte random_bits)
598 {
599  assert(IsTileType(t, MP_STATION));
600  SB(t.m3(), 4, 4, random_bits);
601 }
602 
610 {
611  assert(IsTileType(t, MP_STATION));
612  return GB(t.m3(), 4, 4);
613 }
614 
624 inline void MakeStation(Tile t, Owner o, StationID sid, StationType st, byte section, WaterClass wc = WATER_CLASS_INVALID)
625 {
627  SetTileOwner(t, o);
628  SetWaterClass(t, wc);
629  SetDockingTile(t, false);
630  t.m2() = sid;
631  t.m3() = 0;
632  t.m4() = 0;
633  t.m5() = section;
634  SB(t.m6(), 2, 1, 0);
635  SB(t.m6(), 3, 3, st);
636  t.m7() = 0;
637  t.m8() = 0;
638 }
639 
649 inline void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, byte section, RailType rt)
650 {
651  MakeStation(t, o, sid, STATION_RAIL, section + a);
652  SetRailType(t, rt);
653  SetRailStationReservation(t, false);
654 }
655 
665 inline void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, byte section, RailType rt)
666 {
667  MakeStation(t, o, sid, STATION_WAYPOINT, section + a);
668  SetRailType(t, rt);
669  SetRailStationReservation(t, false);
670 }
671 
682 inline void MakeRoadStop(Tile t, Owner o, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, DiagDirection d)
683 {
684  MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), d);
685  SetRoadTypes(t, road_rt, tram_rt);
686  SetRoadOwner(t, RTT_ROAD, o);
687  SetRoadOwner(t, RTT_TRAM, o);
688 }
689 
702 inline void MakeDriveThroughRoadStop(Tile t, Owner station, Owner road, Owner tram, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, Axis a)
703 {
704  MakeStation(t, station, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
705  SetRoadTypes(t, road_rt, tram_rt);
706  SetRoadOwner(t, RTT_ROAD, road);
707  SetRoadOwner(t, RTT_TRAM, tram);
708 }
709 
718 inline void MakeAirport(Tile t, Owner o, StationID sid, byte section, WaterClass wc)
719 {
720  MakeStation(t, o, sid, STATION_AIRPORT, section, wc);
721 }
722 
729 inline void MakeBuoy(Tile t, StationID sid, WaterClass wc)
730 {
731  /* Make the owner of the buoy tile the same as the current owner of the
732  * water tile. In this way, we can reset the owner of the water to its
733  * original state when the buoy gets removed. */
734  MakeStation(t, GetTileOwner(t), sid, STATION_BUOY, 0, wc);
735 }
736 
745 inline void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
746 {
747  MakeStation(t, o, sid, STATION_DOCK, d);
748  MakeStation(TileIndex(t) + TileOffsByDiagDir(d), o, sid, STATION_DOCK, GFX_DOCK_BASE_WATER_PART + DiagDirToAxis(d), wc);
749 }
750 
757 inline void MakeOilrig(Tile t, StationID sid, WaterClass wc)
758 {
759  MakeStation(t, OWNER_NONE, sid, STATION_OILRIG, 0, wc);
760 }
761 
762 #endif /* STATION_MAP_H */
AXIS_Y
@ AXIS_Y
The y axis.
Definition: direction_type.h:118
MakeRailWaypoint
void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, byte section, RailType rt)
Make the given tile a rail waypoint tile.
Definition: station_map.h:665
TRACK_BIT_NONE
@ TRACK_BIT_NONE
No track.
Definition: track_type.h:36
StationGfx
byte StationGfx
Copy from station_map.h.
Definition: newgrf_airport.h:22
MakeRoadStop
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.
Definition: station_map.h:682
MakeBuoy
void MakeBuoy(Tile t, StationID sid, WaterClass wc)
Make the given tile a buoy tile.
Definition: station_map.h:729
SetRoadTypes
void SetRoadTypes(Tile t, RoadType road_rt, RoadType tram_rt)
Set the present road types of a tile.
Definition: road_map.h:619
GetStationReservationTrackBits
TrackBits GetStationReservationTrackBits(Tile t)
Get the reserved track bits for a waypoint.
Definition: station_map.h:490
RoadStopType
RoadStopType
Types of RoadStops.
Definition: station_type.h:43
ROADSTOP_TRUCK
@ ROADSTOP_TRUCK
A standard stop for trucks.
Definition: station_type.h:45
IsRailStation
bool IsRailStation(Tile t)
Is this station tile a rail station?
Definition: station_map.h:92
IsBusStop
bool IsBusStop(Tile t)
Is the station at t a bus stop?
Definition: station_map.h:191
Axis
Axis
Allow incrementing of DiagDirDiff variables.
Definition: direction_type.h:116
IsHangar
bool IsHangar(Tile t)
Check whether the given tile is a hangar.
Definition: station_cmd.cpp:89
GB
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.
Definition: bitmath_func.hpp:32
DiagDirToAxis
Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
Definition: direction_func.h:214
Tile::m8
debug_inline uint16_t & m8()
General purpose.
Definition: map_func.h:197
Tile::m6
debug_inline byte & m6()
General purpose.
Definition: map_func.h:173
IsOilRig
bool IsOilRig(Tile t)
Is tile t part of an oilrig?
Definition: station_map.h:275
SetStationTileHaveWires
void SetStationTileHaveWires(Tile t, bool b)
Set the catenary wires state of the rail station.
Definition: station_map.h:374
SetStationTileHavePylons
void SetStationTileHavePylons(Tile t, bool b)
Set the catenary pylon state of the rail station.
Definition: station_map.h:398
IsCompatibleTrainStationTile
bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
Check if a tile is a valid continuation to a railstation tile.
Definition: station_map.h:451
IsRailStationTile
bool IsRailStationTile(Tile t)
Is this tile a station tile and a rail station?
Definition: station_map.h:102
Tile
Wrapper class to abstract away the way the tiles are stored.
Definition: map_func.h:25
GetRoadStopDir
DiagDirection GetRoadStopDir(Tile t)
Gets the direction the road stop entrance points towards.
Definition: station_map.h:258
GetDockDirection
DiagDirection GetDockDirection(Tile t)
Get the direction of a dock.
Definition: station_map.h:502
Tile::m5
debug_inline byte & m5()
General purpose.
Definition: map_func.h:161
GetRailType
RailType GetRailType(Tile t)
Gets the rail type of the given tile.
Definition: rail_map.h:115
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
Tile::m4
debug_inline byte & m4()
General purpose.
Definition: map_func.h:149
MakeRailStation
void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, byte section, RailType rt)
Make the given tile a rail station tile.
Definition: station_map.h:649
WATER_CLASS_INVALID
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
Definition: water_map.h:51
IsRailWaypointTile
bool IsRailWaypointTile(Tile t)
Is this tile a station tile and a rail waypoint?
Definition: station_map.h:123
GetRailStationAxis
Axis GetRailStationAxis(Tile t)
Get the rail direction of a rail station.
Definition: station_map.h:410
GetRailStationTrackBits
TrackBits GetRailStationTrackBits(Tile t)
Get the trackbits of a rail station tile.
Definition: station_map.h:433
IsCustomRoadStopSpecIndex
bool IsCustomRoadStopSpecIndex(Tile t)
Is there a custom road stop spec on this tile?
Definition: station_map.h:561
StationType
StationType
Station types.
Definition: station_type.h:31
IsDock
bool IsDock(Tile t)
Is tile t a dock tile?
Definition: station_map.h:286
IsTruckStop
bool IsTruckStop(Tile t)
Is the station at t a truck stop?
Definition: station_map.h:180
Tile::m7
debug_inline byte & m7()
Primarily used for newgrf support.
Definition: map_func.h:185
MakeAirport
void MakeAirport(Tile t, Owner o, StationID sid, byte section, WaterClass wc)
Make the given tile an airport tile.
Definition: station_map.h:718
GetStationGfx
StationGfx GetStationGfx(Tile t)
Get the station graphics of this tile.
Definition: station_map.h:68
SetCustomStationSpecIndex
void SetCustomStationSpecIndex(Tile t, byte specindex)
Set the custom station spec for this tile.
Definition: station_map.h:537
IsBayRoadStopTile
bool IsBayRoadStopTile(Tile t)
Is tile t a bay (non-drive through) road stop station?
Definition: station_map.h:223
RailType
RailType
Enumeration for all possible railtypes.
Definition: rail_type.h:27
Tile::m2
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
Definition: map_func.h:125
WaterClass
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
Definition: water_map.h:47
GetRailStationTrack
Track GetRailStationTrack(Tile t)
Get the rail track of a rail station tile.
Definition: station_map.h:422
StationGfx
byte StationGfx
Index of station graphics.
Definition: station_map.h:20
SetStationGfx
void SetStationGfx(Tile t, StationGfx gfx)
Set the station graphics of this tile.
Definition: station_map.h:80
GetStationTileRandomBits
byte GetStationTileRandomBits(Tile t)
Get the random bits of a station tile.
Definition: station_map.h:609
rail_map.h
station_func.h
HasStationTileRail
bool HasStationTileRail(Tile t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
Definition: station_map.h:146
IsBuoyTile
bool IsBuoyTile(Tile t)
Is tile t a buoy tile?
Definition: station_map.h:317
MakeDriveThroughRoadStop
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.
Definition: station_map.h:702
CanStationTileHavePylons
bool CanStationTileHavePylons(Tile t)
Can tile t have catenary pylons?
Definition: station_map.h:386
SetWaterClass
void SetWaterClass(Tile t, WaterClass wc)
Set the water class at a tile.
Definition: water_map.h:127
IsCompatibleRail
bool IsCompatibleRail(RailType enginetype, RailType tiletype)
Checks if an engine of the given RailType can drive on a tile with a given RailType.
Definition: rail.h:322
rail.h
GetTileOwner
Owner GetTileOwner(Tile tile)
Returns the owner of a tile.
Definition: tile_map.h:178
road.h
DiagDirection
DiagDirection
Enumeration for diagonal directions.
Definition: direction_type.h:73
GFX_DOCK_BASE_WATER_PART
static const int GFX_DOCK_BASE_WATER_PART
The offset for the water parts.
Definition: station_map.h:35
GetCustomRoadStopSpecIndex
uint GetCustomRoadStopSpecIndex(Tile t)
Get the custom road stop spec for this tile.
Definition: station_map.h:585
SetRailStationReservation
void SetRailStationReservation(Tile t, bool b)
Set the reservation state of the rail station.
Definition: station_map.h:478
SetStationTileRandomBits
void SetStationTileRandomBits(Tile t, byte random_bits)
Set the random bits for a station tile.
Definition: station_map.h:597
SetTileOwner
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
Definition: tile_map.h:198
SetStationTileBlocked
void SetStationTileBlocked(Tile t, bool b)
Set the blocked state of the rail station.
Definition: station_map.h:350
GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET
static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET
The offset for the drive through parts.
Definition: station_map.h:36
GetStationType
StationType GetStationType(Tile t)
Get the station type of this tile.
Definition: station_map.h:44
road_map.h
TileOffsByDiagDir
TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
Definition: map_func.h:563
water_map.h
SetCustomRoadStopSpecIndex
void SetCustomRoadStopSpecIndex(Tile t, byte specindex)
Set the custom road stop spec for this tile.
Definition: station_map.h:573
ROADSTOP_BUS
@ ROADSTOP_BUS
A standard stop for buses.
Definition: station_type.h:44
IsBuoy
bool IsBuoy(Tile t)
Is tile t a buoy tile?
Definition: station_map.h:307
IsCustomStationSpecIndex
bool IsCustomStationSpecIndex(Tile t)
Is there a custom rail station spec on this tile?
Definition: station_map.h:525
GetStationIndex
StationID GetStationIndex(Tile t)
Get StationID from a tile.
Definition: station_map.h:28
HasStationReservation
bool HasStationReservation(Tile t)
Get the reservation state of the rail station.
Definition: station_map.h:466
HasStationRail
bool HasStationRail(Tile t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
Definition: station_map.h:135
GetAirportGfx
StationGfx GetAirportGfx(Tile t)
Get the station graphics of this airport tile.
Definition: station_map.h:246
OWNER_NONE
@ OWNER_NONE
The tile has no ownership.
Definition: company_type.h:25
SetDockingTile
void SetDockingTile(Tile t, bool b)
Set the docking tile state of a tile.
Definition: water_map.h:364
SetRailType
void SetRailType(Tile t, RailType r)
Sets the rail type of the given tile.
Definition: rail_map.h:125
IsRoadStop
bool IsRoadStop(Tile t)
Is the station at t a road station?
Definition: station_map.h:202
MP_STATION
@ MP_STATION
A tile of a station.
Definition: tile_type.h:53
SetTileType
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
Definition: tile_map.h:131
RoadType
RoadType
The different roadtypes we support.
Definition: road_type.h:25
TileIndex
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.
Definition: tile_type.h:87
SetRoadOwner
void SetRoadOwner(Tile t, RoadTramType rtt, Owner o)
Set the owner of a specific road type.
Definition: road_map.h:251
AxisToTrack
Track AxisToTrack(Axis a)
Convert an Axis to the corresponding Track AXIS_X -> TRACK_X AXIS_Y -> TRACK_Y Uses the fact that the...
Definition: track_func.h:66
IsDockWaterPart
bool IsDockWaterPart(Tile t)
Check whether a dock tile is the tile on water.
Definition: station_map.h:512
AXIS_X
@ AXIS_X
The X axis.
Definition: direction_type.h:117
TrackBits
TrackBits
Allow incrementing of Track variables.
Definition: track_type.h:35
GetRoadStopType
RoadStopType GetRoadStopType(Tile t)
Get the road stop type of this tile.
Definition: station_map.h:56
IsStationTileBlocked
bool IsStationTileBlocked(Tile t)
Is tile t a blocked tile?
Definition: station_map.h:338
GetTranslatedAirportTileID
StationGfx GetTranslatedAirportTileID(StationGfx gfx)
Do airporttile gfx ID translation for NewGRFs.
Definition: newgrf_airporttiles.cpp:96
MakeStation
void MakeStation(Tile t, Owner o, StationID sid, StationType st, byte section, WaterClass wc=WATER_CLASS_INVALID)
Make the given tile a station tile.
Definition: station_map.h:624
AxisToTrackBits
TrackBits AxisToTrackBits(Axis a)
Maps an Axis to the corresponding TrackBits value.
Definition: track_func.h:88
SB
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.
Definition: bitmath_func.hpp:58
IsAirportTile
bool IsAirportTile(Tile t)
Is this tile a station tile and an airport tile?
Definition: station_map.h:167
IsDockTile
bool IsDockTile(Tile t)
Is tile t a dock tile?
Definition: station_map.h:296
IsTileType
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
Definition: tile_map.h:150
IsRailWaypoint
bool IsRailWaypoint(Tile t)
Is this station tile a rail waypoint?
Definition: station_map.h:113
Track
Track
These are used to specify a single track.
Definition: track_type.h:19
IsRoadStopTile
bool IsRoadStopTile(Tile t)
Is tile t a road stop station?
Definition: station_map.h:213
Tile::m3
debug_inline byte & m3()
General purpose.
Definition: map_func.h:137
CanStationTileHaveWires
bool CanStationTileHaveWires(Tile t)
Can tile t have catenary wires?
Definition: station_map.h:362
IsAirport
bool IsAirport(Tile t)
Is this station tile an airport?
Definition: station_map.h:157
MakeDock
void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
Make the given tile a dock tile.
Definition: station_map.h:745
IsDriveThroughStopTile
bool IsDriveThroughStopTile(Tile t)
Is tile t a drive through road stop station?
Definition: station_map.h:233
MakeOilrig
void MakeOilrig(Tile t, StationID sid, WaterClass wc)
Make the given tile an oilrig tile.
Definition: station_map.h:757
IsHangarTile
bool IsHangarTile(Tile t)
Is tile t an hangar tile?
Definition: station_map.h:327
GetCustomStationSpecIndex
uint GetCustomStationSpecIndex(Tile t)
Get the custom station spec for this tile.
Definition: station_map.h:549
HasBit
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
Definition: bitmath_func.hpp:103