OpenTTD Source  20241124-master-g9399a92a4f
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  assert(IsBayRoadStopTile(t));
347  return static_cast<DiagDirection>(GetStationGfx(t));
348 }
349 
357 {
358  assert(IsDriveThroughStopTile(t));
359  return static_cast<Axis>(GetStationGfx(t) - GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET);
360 }
361 
368 inline bool IsOilRig(Tile t)
369 {
370  return GetStationType(t) == STATION_OILRIG;
371 }
372 
379 inline bool IsDock(Tile t)
380 {
381  return GetStationType(t) == STATION_DOCK;
382 }
383 
389 inline bool IsDockTile(Tile t)
390 {
391  return IsTileType(t, MP_STATION) && GetStationType(t) == STATION_DOCK;
392 }
393 
400 inline bool IsBuoy(Tile t)
401 {
402  return GetStationType(t) == STATION_BUOY;
403 }
404 
410 inline bool IsBuoyTile(Tile t)
411 {
412  return IsTileType(t, MP_STATION) && IsBuoy(t);
413 }
414 
420 inline bool IsHangarTile(Tile t)
421 {
422  return IsTileType(t, MP_STATION) && IsHangar(t);
423 }
424 
432 {
433  assert(HasStationRail(t));
434  return HasBit(t.m6(), 0);
435 }
436 
443 inline void SetStationTileBlocked(Tile t, bool b)
444 {
445  assert(HasStationRail(t));
446  AssignBit(t.m6(), 0, b);
447 }
448 
456 {
457  assert(HasStationRail(t));
458  return HasBit(t.m6(), 1);
459 }
460 
467 inline void SetStationTileHaveWires(Tile t, bool b)
468 {
469  assert(HasStationRail(t));
470  AssignBit(t.m6(), 1, b);
471 }
472 
480 {
481  assert(HasStationRail(t));
482  return HasBit(t.m6(), 7);
483 }
484 
491 inline void SetStationTileHavePylons(Tile t, bool b)
492 {
493  assert(HasStationRail(t));
494  AssignBit(t.m6(), 7, b);
495 }
496 
504 {
505  assert(HasStationRail(t));
506  return HasBit(GetStationGfx(t), 0) ? AXIS_Y : AXIS_X;
507 }
508 
516 {
517  return AxisToTrack(GetRailStationAxis(t));
518 }
519 
527 {
529 }
530 
544 inline bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
545 {
546  assert(IsRailStationTile(station_tile));
547  return IsRailStationTile(test_tile) && !IsStationTileBlocked(test_tile) &&
548  IsCompatibleRail(GetRailType(test_tile), GetRailType(station_tile)) &&
549  GetRailStationAxis(test_tile) == GetRailStationAxis(station_tile) &&
550  GetStationIndex(test_tile) == GetStationIndex(station_tile);
551 }
552 
560 {
561  assert(HasStationRail(t));
562  return HasBit(t.m6(), 2);
563 }
564 
571 inline void SetRailStationReservation(Tile t, bool b)
572 {
573  assert(HasStationRail(t));
574  AssignBit(t.m6(), 2, b);
575 }
576 
584 {
586 }
587 
596 {
597  StationGfx gfx = GetStationGfx(t);
598  assert(IsDock(t) && gfx < GFX_DOCK_BASE_WATER_PART);
599  return (DiagDirection)(gfx);
600 }
601 
605 inline bool IsDockWaterPart(Tile t)
606 {
607  assert(IsDockTile(t));
608  StationGfx gfx = GetStationGfx(t);
609  return gfx >= GFX_DOCK_BASE_WATER_PART;
610 }
611 
619 {
620  assert(HasStationTileRail(t));
621  return t.m4() != 0;
622 }
623 
630 inline void SetCustomStationSpecIndex(Tile t, uint8_t specindex)
631 {
632  assert(HasStationTileRail(t));
633  t.m4() = specindex;
634 }
635 
643 {
644  assert(HasStationTileRail(t));
645  return t.m4();
646 }
647 
655 {
656  assert(IsAnyRoadStopTile(t));
657  return GB(t.m8(), 0, 6) != 0;
658 }
659 
666 inline void SetCustomRoadStopSpecIndex(Tile t, uint8_t specindex)
667 {
668  assert(IsAnyRoadStopTile(t));
669  SB(t.m8(), 0, 6, specindex);
670 }
671 
679 {
680  assert(IsAnyRoadStopTile(t));
681  return GB(t.m8(), 0, 6);
682 }
683 
690 inline void SetStationTileRandomBits(Tile t, uint8_t random_bits)
691 {
692  assert(IsTileType(t, MP_STATION));
693  SB(t.m3(), 4, 4, random_bits);
694 }
695 
703 {
704  assert(IsTileType(t, MP_STATION));
705  return GB(t.m3(), 4, 4);
706 }
707 
717 inline void MakeStation(Tile t, Owner o, StationID sid, StationType st, uint8_t section, WaterClass wc = WATER_CLASS_INVALID)
718 {
720  SetTileOwner(t, o);
721  SetWaterClass(t, wc);
722  SetDockingTile(t, false);
723  t.m2() = sid;
724  t.m3() = 0;
725  t.m4() = 0;
726  t.m5() = section;
727  SB(t.m6(), 2, 1, 0);
728  SB(t.m6(), 3, 4, st);
729  t.m7() = 0;
730  t.m8() = 0;
731 }
732 
742 inline void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
743 {
744  MakeStation(t, o, sid, STATION_RAIL, section + a);
745  SetRailType(t, rt);
746  SetRailStationReservation(t, false);
747 }
748 
758 inline void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
759 {
760  MakeStation(t, o, sid, STATION_WAYPOINT, section + a);
761  SetRailType(t, rt);
762  SetRailStationReservation(t, false);
763 }
764 
775 inline void MakeRoadStop(Tile t, Owner o, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, DiagDirection d)
776 {
777  MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), d);
778  SetRoadTypes(t, road_rt, tram_rt);
779  SetRoadOwner(t, RTT_ROAD, o);
780  SetRoadOwner(t, RTT_TRAM, o);
781 }
782 
795 inline void MakeDriveThroughRoadStop(Tile t, Owner station, Owner road, Owner tram, StationID sid, StationType rst, RoadType road_rt, RoadType tram_rt, Axis a)
796 {
797  MakeStation(t, station, sid, rst, GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
798  SetRoadTypes(t, road_rt, tram_rt);
799  SetRoadOwner(t, RTT_ROAD, road);
800  SetRoadOwner(t, RTT_TRAM, tram);
801 }
802 
811 inline void MakeAirport(Tile t, Owner o, StationID sid, uint8_t section, WaterClass wc)
812 {
813  MakeStation(t, o, sid, STATION_AIRPORT, section, wc);
814 }
815 
822 inline void MakeBuoy(Tile t, StationID sid, WaterClass wc)
823 {
824  /* Make the owner of the buoy tile the same as the current owner of the
825  * water tile. In this way, we can reset the owner of the water to its
826  * original state when the buoy gets removed. */
827  MakeStation(t, GetTileOwner(t), sid, STATION_BUOY, 0, wc);
828 }
829 
838 inline void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
839 {
840  MakeStation(t, o, sid, STATION_DOCK, d);
841  MakeStation(TileIndex(t) + TileOffsByDiagDir(d), o, sid, STATION_DOCK, GFX_DOCK_BASE_WATER_PART + DiagDirToAxis(d), wc);
842 }
843 
850 inline void MakeOilrig(Tile t, StationID sid, WaterClass wc)
851 {
852  MakeStation(t, OWNER_NONE, sid, STATION_OILRIG, 0, wc);
853 }
854 
855 #endif /* STATION_MAP_H */
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.
Definition: map_func.h:25
debug_inline uint16_t & m8()
General purpose.
Definition: map_func.h:197
debug_inline uint8_t & m7()
Primarily used for newgrf support.
Definition: map_func.h:185
debug_inline uint8_t & m5()
General purpose.
Definition: map_func.h:161
debug_inline uint8_t & m4()
General purpose.
Definition: map_func.h:149
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
Definition: map_func.h:125
debug_inline uint8_t & m6()
General purpose.
Definition: map_func.h:173
debug_inline uint8_t & m3()
General purpose.
Definition: map_func.h:137
Owner
Enum for all companies/owners.
Definition: company_type.h:18
@ OWNER_NONE
The tile has no ownership.
Definition: company_type.h:25
Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
Axis
Allow incrementing of DiagDirDiff variables.
@ AXIS_X
The X axis.
@ AXIS_Y
The y axis.
DiagDirection
Enumeration for diagonal directions.
TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
Definition: map_func.h:567
uint8_t StationGfx
Copy from station_map.h.
Rail specific functions.
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
Hides the direct accesses to the map array with map accessors.
RailType GetRailType(Tile t)
Gets the rail type of the given tile.
Definition: rail_map.h:115
void SetRailType(Tile t, RailType r)
Sets the rail type of the given tile.
Definition: rail_map.h:125
RailType
Enumeration for all possible railtypes.
Definition: rail_type.h:27
Road specific functions.
Map accessors for roads.
void SetRoadOwner(Tile t, RoadTramType rtt, Owner o)
Set the owner of a specific road type.
Definition: road_map.h:251
void SetRoadTypes(Tile t, RoadType road_rt, RoadType tram_rt)
Set the present road types of a tile.
Definition: road_map.h:619
Roadside
The possible road side decorations.
Definition: road_map.h:477
RoadType
The different roadtypes we support.
Definition: road_type.h:25
Functions related to stations.
void MakeAirport(Tile t, Owner o, StationID sid, uint8_t section, WaterClass wc)
Make the given tile an airport tile.
Definition: station_map.h:811
StationType GetStationType(Tile t)
Get the station type of this tile.
Definition: station_map.h:44
bool IsStationRoadStopTile(Tile t)
Is tile t a road stop station?
Definition: station_map.h:234
StationGfx GetStationGfx(Tile t)
Get the station graphics of this tile.
Definition: station_map.h:68
void SetStationGfx(Tile t, StationGfx gfx)
Set the station graphics of this tile.
Definition: station_map.h:80
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:775
void SetCustomStationSpecIndex(Tile t, uint8_t specindex)
Set the custom station spec for this tile.
Definition: station_map.h:630
TrackBits GetRailStationTrackBits(Tile t)
Get the trackbits of a rail station tile.
Definition: station_map.h:526
void SetStationTileHaveWires(Tile t, bool b)
Set the catenary wires state of the rail station.
Definition: station_map.h:467
bool IsAirportTile(Tile t)
Is this tile a station tile and an airport tile?
Definition: station_map.h:167
bool IsAirport(Tile t)
Is this station tile an airport?
Definition: station_map.h:157
bool IsBayRoadStopTile(Tile t)
Is tile t a bay (non-drive through) road stop station?
Definition: station_map.h:266
bool IsRailWaypointTile(Tile t)
Is this tile a station tile and a rail waypoint?
Definition: station_map.h:123
StationGfx GetTranslatedAirportTileID(StationGfx gfx)
Do airporttile gfx ID translation for NewGRFs.
uint GetCustomRoadStopSpecIndex(Tile t)
Get the custom road stop spec for this tile.
Definition: station_map.h:678
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:717
static const int GFX_DOCK_BASE_WATER_PART
The offset for the water parts.
Definition: station_map.h:35
bool IsHangar(Tile t)
Check whether the given tile is a hangar.
Definition: station_cmd.cpp:92
bool IsBuoy(Tile t)
Is tile t a buoy tile?
Definition: station_map.h:400
bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
Check if a tile is a valid continuation to a railstation tile.
Definition: station_map.h:544
bool IsRoadWaypoint(Tile t)
Is the station at t a road waypoint?
Definition: station_map.h:202
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:795
bool IsDriveThroughStopTile(Tile t)
Is tile t a drive through road stop station or waypoint?
Definition: station_map.h:276
uint8_t GetStationTileRandomBits(Tile t)
Get the random bits of a station tile.
Definition: station_map.h:702
static Roadside GetRoadWaypointRoadside(Tile tile)
Get the decorations of a road waypoint.
Definition: station_map.h:288
bool IsRailStationTile(Tile t)
Is this tile a station tile and a rail station?
Definition: station_map.h:102
Track GetRailStationTrack(Tile t)
Get the rail track of a rail station tile.
Definition: station_map.h:515
static void ToggleRoadWaypointOnSnowOrDesert(Tile t)
Toggle the snow/desert state of a road waypoint tile.
Definition: station_map.h:320
StationID GetStationIndex(Tile t)
Get StationID from a tile.
Definition: station_map.h:28
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
StationGfx GetAirportGfx(Tile t)
Get the station graphics of this airport tile.
Definition: station_map.h:332
bool CanStationTileHaveWires(Tile t)
Can tile t have catenary wires?
Definition: station_map.h:455
uint GetCustomStationSpecIndex(Tile t)
Get the custom station spec for this tile.
Definition: station_map.h:642
bool IsRailWaypoint(Tile t)
Is this station tile a rail waypoint?
Definition: station_map.h:113
bool IsRailStation(Tile t)
Is this station tile a rail station?
Definition: station_map.h:92
bool IsHangarTile(Tile t)
Is tile t an hangar tile?
Definition: station_map.h:420
bool IsDockTile(Tile t)
Is tile t a dock tile?
Definition: station_map.h:389
static void SetRoadWaypointRoadside(Tile tile, Roadside s)
Set the decorations of a road waypoint.
Definition: station_map.h:299
void SetStationTileRandomBits(Tile t, uint8_t random_bits)
Set the random bits for a station tile.
Definition: station_map.h:690
void SetRailStationReservation(Tile t, bool b)
Set the reservation state of the rail station.
Definition: station_map.h:571
bool IsAnyRoadStop(Tile t)
Is the station at t a road station?
Definition: station_map.h:245
void MakeOilrig(Tile t, StationID sid, WaterClass wc)
Make the given tile an oilrig tile.
Definition: station_map.h:850
DiagDirection GetDockDirection(Tile t)
Get the direction of a dock.
Definition: station_map.h:595
Axis GetRailStationAxis(Tile t)
Get the rail direction of a rail station.
Definition: station_map.h:503
static bool IsRoadWaypointOnSnowOrDesert(Tile t)
Check if a road waypoint tile has snow/desert.
Definition: station_map.h:310
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:758
bool IsRoadWaypointTile(Tile t)
Is this tile a station tile and a road waypoint?
Definition: station_map.h:212
bool IsStationTileBlocked(Tile t)
Is tile t a blocked tile?
Definition: station_map.h:431
bool IsTruckStop(Tile t)
Is the station at t a truck stop?
Definition: station_map.h:180
uint8_t StationGfx
Index of station graphics.
Definition: station_map.h:20
bool IsStationRoadStop(Tile t)
Is the station at t a road station?
Definition: station_map.h:223
bool IsBusStop(Tile t)
Is the station at t a bus stop?
Definition: station_map.h:191
bool IsCustomStationSpecIndex(Tile t)
Is there a custom rail station spec on this tile?
Definition: station_map.h:618
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
static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET
The offset for the drive through parts.
Definition: station_map.h:36
Axis GetDriveThroughStopAxis(Tile t)
Gets the axis of the drive through stop.
Definition: station_map.h:356
void SetStationTileHavePylons(Tile t, bool b)
Set the catenary pylon state of the rail station.
Definition: station_map.h:491
bool CanStationTileHavePylons(Tile t)
Can tile t have catenary pylons?
Definition: station_map.h:479
bool IsOilRig(Tile t)
Is tile t part of an oilrig?
Definition: station_map.h:368
bool IsBuoyTile(Tile t)
Is tile t a buoy tile?
Definition: station_map.h:410
bool IsDockWaterPart(Tile t)
Check whether a dock tile is the tile on water.
Definition: station_map.h:605
void MakeBuoy(Tile t, StationID sid, WaterClass wc)
Make the given tile a buoy tile.
Definition: station_map.h:822
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:742
bool HasStationReservation(Tile t)
Get the reservation state of the rail station.
Definition: station_map.h:559
bool IsCustomRoadStopSpecIndex(Tile t)
Is there a custom road stop spec on this tile?
Definition: station_map.h:654
void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
Make the given tile a dock tile.
Definition: station_map.h:838
DiagDirection GetBayRoadStopDir(Tile t)
Gets the direction the bay road stop entrance points towards.
Definition: station_map.h:344
bool IsDock(Tile t)
Is tile t a dock tile?
Definition: station_map.h:379
bool IsAnyRoadStopTile(Tile t)
Is tile t a road stop station?
Definition: station_map.h:256
void SetStationTileBlocked(Tile t, bool b)
Set the blocked state of the rail station.
Definition: station_map.h:443
TrackBits GetStationReservationTrackBits(Tile t)
Get the reserved track bits for a waypoint.
Definition: station_map.h:583
RoadStopType GetRoadStopType(Tile t)
Get the road stop type of this tile.
Definition: station_map.h:56
void SetCustomRoadStopSpecIndex(Tile t, uint8_t specindex)
Set the custom road stop spec for this tile.
Definition: station_map.h:666
RoadStopType
Types of RoadStops.
Definition: station_type.h:45
@ ROADSTOP_BUS
A standard stop for buses.
Definition: station_type.h:46
@ ROADSTOP_TRUCK
A standard stop for trucks.
Definition: station_type.h:47
StationType
Station types.
Definition: station_type.h:31
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
Definition: tile_map.h:131
Owner GetTileOwner(Tile tile)
Returns the owner of a tile.
Definition: tile_map.h:178
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
Definition: tile_map.h:198
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
Definition: tile_map.h:150
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
@ MP_STATION
A tile of a station.
Definition: tile_type.h:53
TrackBits AxisToTrackBits(Axis a)
Maps an Axis to the corresponding TrackBits value.
Definition: track_func.h:88
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
TrackBits
Allow incrementing of Track variables.
Definition: track_type.h:35
@ TRACK_BIT_NONE
No track.
Definition: track_type.h:36
Track
These are used to specify a single track.
Definition: track_type.h:19
Map accessors for water tiles.
void SetWaterClass(Tile t, WaterClass wc)
Set the water class at a tile.
Definition: water_map.h:124
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
Definition: water_map.h:39
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
Definition: water_map.h:43
void SetDockingTile(Tile t, bool b)
Set the docking tile state of a tile.
Definition: water_map.h:361