OpenTTD Source  20240915-master-g3784a3d3d6
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 uint8_t 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, 4);
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 IsRoadWaypoint(Tile t)
203 {
204  return GetStationType(t) == STATION_ROADWAYPOINT;
205 }
206 
212 inline bool IsRoadWaypointTile(Tile t)
213 {
214  return IsTileType(t, MP_STATION) && IsRoadWaypoint(t);
215 }
216 
223 inline bool IsStationRoadStop(Tile t)
224 {
225  assert(IsTileType(t, MP_STATION));
226  return IsTruckStop(t) || IsBusStop(t);
227 }
228 
235 {
236  return IsTileType(t, MP_STATION) && IsStationRoadStop(t);
237 }
238 
245 inline bool IsAnyRoadStop(Tile t)
246 {
247  assert(IsTileType(t, MP_STATION));
248  return IsTruckStop(t) || IsBusStop(t) || IsRoadWaypoint(t);
249 }
250 
256 inline bool IsAnyRoadStopTile(Tile t)
257 {
258  return IsTileType(t, MP_STATION) && IsAnyRoadStop(t);
259 }
260 
266 inline bool IsBayRoadStopTile(Tile t)
267 {
269 }
270 
277 {
279 }
280 
282 
289 {
290  assert(IsRoadWaypointTile(tile));
291  return (Roadside)GB(tile.m3(), 2, 2);
292 }
293 
299 static inline void SetRoadWaypointRoadside(Tile tile, Roadside s)
300 {
301  assert(IsRoadWaypointTile(tile));
302  SB(tile.m3(), 2, 2, s);
303 }
304 
310 static inline bool IsRoadWaypointOnSnowOrDesert(Tile t)
311 {
312  assert(IsRoadWaypointTile(t));
313  return HasBit(t.m8(), 15);
314 }
315 
321 {
322  assert(IsRoadWaypointTile(t));
323  ToggleBit(t.m8(), 15);
324 }
325 
333 {
334  assert(IsAirport(t));
336 }
337 
345 {
346  StationGfx gfx = GetStationGfx(t);
347  assert(IsAnyRoadStopTile(t));
349  return (DiagDirection)(gfx);
350  } else {
352  }
353 }
354 
361 inline bool IsOilRig(Tile t)
362 {
363  return GetStationType(t) == STATION_OILRIG;
364 }
365 
372 inline bool IsDock(Tile t)
373 {
374  return GetStationType(t) == STATION_DOCK;
375 }
376 
382 inline bool IsDockTile(Tile t)
383 {
384  return IsTileType(t, MP_STATION) && GetStationType(t) == STATION_DOCK;
385 }
386 
393 inline bool IsBuoy(Tile t)
394 {
395  return GetStationType(t) == STATION_BUOY;
396 }
397 
403 inline bool IsBuoyTile(Tile t)
404 {
405  return IsTileType(t, MP_STATION) && IsBuoy(t);
406 }
407 
413 inline bool IsHangarTile(Tile t)
414 {
415  return IsTileType(t, MP_STATION) && IsHangar(t);
416 }
417 
425 {
426  assert(HasStationRail(t));
427  return HasBit(t.m6(), 0);
428 }
429 
436 inline void SetStationTileBlocked(Tile t, bool b)
437 {
438  assert(HasStationRail(t));
439  AssignBit(t.m6(), 0, b);
440 }
441 
449 {
450  assert(HasStationRail(t));
451  return HasBit(t.m6(), 1);
452 }
453 
460 inline void SetStationTileHaveWires(Tile t, bool b)
461 {
462  assert(HasStationRail(t));
463  AssignBit(t.m6(), 1, b);
464 }
465 
473 {
474  assert(HasStationRail(t));
475  return HasBit(t.m6(), 7);
476 }
477 
484 inline void SetStationTileHavePylons(Tile t, bool b)
485 {
486  assert(HasStationRail(t));
487  AssignBit(t.m6(), 7, b);
488 }
489 
497 {
498  assert(HasStationRail(t));
499  return HasBit(GetStationGfx(t), 0) ? AXIS_Y : AXIS_X;
500 }
501 
509 {
510  return AxisToTrack(GetRailStationAxis(t));
511 }
512 
520 {
522 }
523 
537 inline bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
538 {
539  assert(IsRailStationTile(station_tile));
540  return IsRailStationTile(test_tile) && !IsStationTileBlocked(test_tile) &&
541  IsCompatibleRail(GetRailType(test_tile), GetRailType(station_tile)) &&
542  GetRailStationAxis(test_tile) == GetRailStationAxis(station_tile) &&
543  GetStationIndex(test_tile) == GetStationIndex(station_tile);
544 }
545 
553 {
554  assert(HasStationRail(t));
555  return HasBit(t.m6(), 2);
556 }
557 
564 inline void SetRailStationReservation(Tile t, bool b)
565 {
566  assert(HasStationRail(t));
567  AssignBit(t.m6(), 2, b);
568 }
569 
577 {
579 }
580 
589 {
590  StationGfx gfx = GetStationGfx(t);
591  assert(IsDock(t) && gfx < GFX_DOCK_BASE_WATER_PART);
592  return (DiagDirection)(gfx);
593 }
594 
598 inline bool IsDockWaterPart(Tile t)
599 {
600  assert(IsDockTile(t));
601  StationGfx gfx = GetStationGfx(t);
602  return gfx >= GFX_DOCK_BASE_WATER_PART;
603 }
604 
612 {
613  assert(HasStationTileRail(t));
614  return t.m4() != 0;
615 }
616 
623 inline void SetCustomStationSpecIndex(Tile t, uint8_t specindex)
624 {
625  assert(HasStationTileRail(t));
626  t.m4() = specindex;
627 }
628 
636 {
637  assert(HasStationTileRail(t));
638  return t.m4();
639 }
640 
648 {
649  assert(IsAnyRoadStopTile(t));
650  return GB(t.m8(), 0, 6) != 0;
651 }
652 
659 inline void SetCustomRoadStopSpecIndex(Tile t, uint8_t specindex)
660 {
661  assert(IsAnyRoadStopTile(t));
662  SB(t.m8(), 0, 6, specindex);
663 }
664 
672 {
673  assert(IsAnyRoadStopTile(t));
674  return GB(t.m8(), 0, 6);
675 }
676 
683 inline void SetStationTileRandomBits(Tile t, uint8_t random_bits)
684 {
685  assert(IsTileType(t, MP_STATION));
686  SB(t.m3(), 4, 4, random_bits);
687 }
688 
696 {
697  assert(IsTileType(t, MP_STATION));
698  return GB(t.m3(), 4, 4);
699 }
700 
710 inline void MakeStation(Tile t, Owner o, StationID sid, StationType st, uint8_t section, WaterClass wc = WATER_CLASS_INVALID)
711 {
713  SetTileOwner(t, o);
714  SetWaterClass(t, wc);
715  SetDockingTile(t, false);
716  t.m2() = sid;
717  t.m3() = 0;
718  t.m4() = 0;
719  t.m5() = section;
720  SB(t.m6(), 2, 1, 0);
721  SB(t.m6(), 3, 4, st);
722  t.m7() = 0;
723  t.m8() = 0;
724 }
725 
735 inline void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
736 {
737  MakeStation(t, o, sid, STATION_RAIL, section + a);
738  SetRailType(t, rt);
739  SetRailStationReservation(t, false);
740 }
741 
751 inline void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
752 {
753  MakeStation(t, o, sid, STATION_WAYPOINT, section + a);
754  SetRailType(t, rt);
755  SetRailStationReservation(t, false);
756 }
757 
768 inline void MakeRoadStop(Tile t, Owner o, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, DiagDirection d)
769 {
770  MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), d);
771  SetRoadTypes(t, road_rt, tram_rt);
772  SetRoadOwner(t, RTT_ROAD, o);
773  SetRoadOwner(t, RTT_TRAM, o);
774 }
775 
788 inline void MakeDriveThroughRoadStop(Tile t, Owner station, Owner road, Owner tram, StationID sid, StationType rst, RoadType road_rt, RoadType tram_rt, Axis a)
789 {
790  MakeStation(t, station, sid, rst, GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
791  SetRoadTypes(t, road_rt, tram_rt);
792  SetRoadOwner(t, RTT_ROAD, road);
793  SetRoadOwner(t, RTT_TRAM, tram);
794 }
795 
804 inline void MakeAirport(Tile t, Owner o, StationID sid, uint8_t section, WaterClass wc)
805 {
806  MakeStation(t, o, sid, STATION_AIRPORT, section, wc);
807 }
808 
815 inline void MakeBuoy(Tile t, StationID sid, WaterClass wc)
816 {
817  /* Make the owner of the buoy tile the same as the current owner of the
818  * water tile. In this way, we can reset the owner of the water to its
819  * original state when the buoy gets removed. */
820  MakeStation(t, GetTileOwner(t), sid, STATION_BUOY, 0, wc);
821 }
822 
831 inline void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
832 {
833  MakeStation(t, o, sid, STATION_DOCK, d);
834  MakeStation(TileIndex(t) + TileOffsByDiagDir(d), o, sid, STATION_DOCK, GFX_DOCK_BASE_WATER_PART + DiagDirToAxis(d), wc);
835 }
836 
843 inline void MakeOilrig(Tile t, StationID sid, WaterClass wc)
844 {
845  MakeStation(t, OWNER_NONE, sid, STATION_OILRIG, 0, wc);
846 }
847 
848 #endif /* STATION_MAP_H */
ROADSTOP_BUS
@ ROADSTOP_BUS
A standard stop for buses.
Definition: station_type.h:46
MakeStation
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.
Definition: station_map.h:710
StationGfx
uint8_t StationGfx
Index of station graphics.
Definition: station_map.h:20
Tile::m5
debug_inline uint8_t & m5()
General purpose.
Definition: map_func.h:161
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:768
MakeBuoy
void MakeBuoy(Tile t, StationID sid, WaterClass wc)
Make the given tile a buoy tile.
Definition: station_map.h:815
IsRoadWaypointOnSnowOrDesert
static bool IsRoadWaypointOnSnowOrDesert(Tile t)
Check if a road waypoint tile has snow/desert.
Definition: station_map.h:310
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:576
Tile::m3
debug_inline uint8_t & m3()
General purpose.
Definition: map_func.h:137
SetCustomRoadStopSpecIndex
void SetCustomRoadStopSpecIndex(Tile t, uint8_t specindex)
Set the custom road stop spec for this tile.
Definition: station_map.h:659
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
GetRoadWaypointRoadside
static Roadside GetRoadWaypointRoadside(Tile tile)
Get the decorations of a road waypoint.
Definition: station_map.h:288
IsHangar
bool IsHangar(Tile t)
Check whether the given tile is a hangar.
Definition: station_cmd.cpp:92
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
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
RailType
RailType
Enumeration for all possible railtypes.
Definition: rail_type.h:27
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
IsOilRig
bool IsOilRig(Tile t)
Is tile t part of an oilrig?
Definition: station_map.h:361
SetStationTileHaveWires
void SetStationTileHaveWires(Tile t, bool b)
Set the catenary wires state of the rail station.
Definition: station_map.h:460
SetStationTileHavePylons
void SetStationTileHavePylons(Tile t, bool b)
Set the catenary pylon state of the rail station.
Definition: station_map.h:484
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:537
IsRailStationTile
bool IsRailStationTile(Tile t)
Is this tile a station tile and a rail station?
Definition: station_map.h:102
DiagDirection
DiagDirection
Enumeration for diagonal directions.
Definition: direction_type.h:73
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:344
GetDockDirection
DiagDirection GetDockDirection(Tile t)
Get the direction of a dock.
Definition: station_map.h:588
Tile::m4
debug_inline uint8_t & m4()
General purpose.
Definition: map_func.h:149
GetRailType
RailType GetRailType(Tile t)
Gets the rail type of the given tile.
Definition: rail_map.h:115
Tile::m7
debug_inline uint8_t & m7()
Primarily used for newgrf support.
Definition: map_func.h:185
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:496
ROADSTOP_TRUCK
@ ROADSTOP_TRUCK
A standard stop for trucks.
Definition: station_type.h:47
StationType
StationType
Station types.
Definition: station_type.h:31
GetRailStationTrackBits
TrackBits GetRailStationTrackBits(Tile t)
Get the trackbits of a rail station tile.
Definition: station_map.h:519
IsCustomRoadStopSpecIndex
bool IsCustomRoadStopSpecIndex(Tile t)
Is there a custom road stop spec on this tile?
Definition: station_map.h:647
TRACK_BIT_NONE
@ TRACK_BIT_NONE
No track.
Definition: track_type.h:36
IsDock
bool IsDock(Tile t)
Is tile t a dock tile?
Definition: station_map.h:372
IsTruckStop
bool IsTruckStop(Tile t)
Is the station at t a truck stop?
Definition: station_map.h:180
MakeDriveThroughRoadStop
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.
Definition: station_map.h:788
GetStationGfx
StationGfx GetStationGfx(Tile t)
Get the station graphics of this tile.
Definition: station_map.h:68
IsBayRoadStopTile
bool IsBayRoadStopTile(Tile t)
Is tile t a bay (non-drive through) road stop station?
Definition: station_map.h:266
Tile::m2
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
Definition: map_func.h:125
GetRailStationTrack
Track GetRailStationTrack(Tile t)
Get the rail track of a rail station tile.
Definition: station_map.h:508
SetStationGfx
void SetStationGfx(Tile t, StationGfx gfx)
Set the station graphics of this tile.
Definition: station_map.h:80
StationGfx
uint8_t StationGfx
Copy from station_map.h.
Definition: newgrf_airport.h:22
OWNER_NONE
@ OWNER_NONE
The tile has no ownership.
Definition: company_type.h:25
TrackBits
TrackBits
Allow incrementing of Track variables.
Definition: track_type.h:35
Roadside
Roadside
The possible road side decorations.
Definition: road_map.h:477
GetStationTileRandomBits
uint8_t GetStationTileRandomBits(Tile t)
Get the random bits of a station tile.
Definition: station_map.h:695
rail_map.h
WATER_CLASS_INVALID
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
Definition: water_map.h:51
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:403
RoadType
RoadType
The different roadtypes we support.
Definition: road_type.h:25
CanStationTileHavePylons
bool CanStationTileHavePylons(Tile t)
Can tile t have catenary pylons?
Definition: station_map.h:472
SetWaterClass
void SetWaterClass(Tile t, WaterClass wc)
Set the water class at a tile.
Definition: water_map.h:127
SetCustomStationSpecIndex
void SetCustomStationSpecIndex(Tile t, uint8_t specindex)
Set the custom station spec for this tile.
Definition: station_map.h:623
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
Tile::m6
debug_inline uint8_t & m6()
General purpose.
Definition: map_func.h:173
ToggleRoadWaypointOnSnowOrDesert
static void ToggleRoadWaypointOnSnowOrDesert(Tile t)
Toggle the snow/desert state of a road waypoint tile.
Definition: station_map.h:320
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:671
SetRailStationReservation
void SetRailStationReservation(Tile t, bool b)
Set the reservation state of the rail station.
Definition: station_map.h:564
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:436
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
AXIS_X
@ AXIS_X
The X axis.
Definition: direction_type.h:117
IsStationRoadStopTile
bool IsStationRoadStopTile(Tile t)
Is tile t a road stop station?
Definition: station_map.h:234
TileOffsByDiagDir
TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
Definition: map_func.h:565
water_map.h
IsRoadWaypoint
bool IsRoadWaypoint(Tile t)
Is the station at t a road waypoint?
Definition: station_map.h:202
AssignBit
constexpr T AssignBit(T &x, const uint8_t y, bool value)
Assigns a bit in a variable.
Definition: bitmath_func.hpp:200
Track
Track
These are used to specify a single track.
Definition: track_type.h:19
IsBuoy
bool IsBuoy(Tile t)
Is tile t a buoy tile?
Definition: station_map.h:393
IsCustomStationSpecIndex
bool IsCustomStationSpecIndex(Tile t)
Is there a custom rail station spec on this tile?
Definition: station_map.h:611
MakeAirport
void MakeAirport(Tile t, Owner o, StationID sid, uint8_t section, WaterClass wc)
Make the given tile an airport tile.
Definition: station_map.h:804
Axis
Axis
Allow incrementing of DiagDirDiff variables.
Definition: direction_type.h:116
IsRoadWaypointTile
bool IsRoadWaypointTile(Tile t)
Is this tile a station tile and a road waypoint?
Definition: station_map.h:212
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:552
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:332
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
MakeRailWaypoint
void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
Make the given tile a rail waypoint tile.
Definition: station_map.h:751
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
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
SetRoadWaypointRoadside
static void SetRoadWaypointRoadside(Tile tile, Roadside s)
Set the decorations of a road waypoint.
Definition: station_map.h:299
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:598
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:424
RoadStopType
RoadStopType
Types of RoadStops.
Definition: station_type.h:45
GetTranslatedAirportTileID
StationGfx GetTranslatedAirportTileID(StationGfx gfx)
Do airporttile gfx ID translation for NewGRFs.
Definition: newgrf_airporttiles.cpp:96
IsStationRoadStop
bool IsStationRoadStop(Tile t)
Is the station at t a road station?
Definition: station_map.h:223
SetStationTileRandomBits
void SetStationTileRandomBits(Tile t, uint8_t random_bits)
Set the random bits for a station tile.
Definition: station_map.h:683
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:382
IsAnyRoadStop
bool IsAnyRoadStop(Tile t)
Is the station at t a road station?
Definition: station_map.h:245
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
AXIS_Y
@ AXIS_Y
The y axis.
Definition: direction_type.h:118
WaterClass
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
Definition: water_map.h:47
IsAnyRoadStopTile
bool IsAnyRoadStopTile(Tile t)
Is tile t a road stop station?
Definition: station_map.h:256
CanStationTileHaveWires
bool CanStationTileHaveWires(Tile t)
Can tile t have catenary wires?
Definition: station_map.h:448
IsAirport
bool IsAirport(Tile t)
Is this station tile an airport?
Definition: station_map.h:157
ToggleBit
constexpr T ToggleBit(T &x, const uint8_t y)
Toggles a bit in a variable.
Definition: bitmath_func.hpp:181
MakeDock
void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
Make the given tile a dock tile.
Definition: station_map.h:831
IsDriveThroughStopTile
bool IsDriveThroughStopTile(Tile t)
Is tile t a drive through road stop station or waypoint?
Definition: station_map.h:276
MakeOilrig
void MakeOilrig(Tile t, StationID sid, WaterClass wc)
Make the given tile an oilrig tile.
Definition: station_map.h:843
MakeRailStation
void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
Make the given tile a rail station tile.
Definition: station_map.h:735
IsHangarTile
bool IsHangarTile(Tile t)
Is tile t an hangar tile?
Definition: station_map.h:413
GetCustomStationSpecIndex
uint GetCustomStationSpecIndex(Tile t)
Get the custom station spec for this tile.
Definition: station_map.h:635
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