Codechange: Return pair from instead of optional out parameter. (#13166)
[openttd-github.git] / src / station_map.h
blob0a4a5412005445f8d2fc174e28e28ae839763869
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 */
8 /** @file station_map.h Maps accessors for stations. */
10 #ifndef STATION_MAP_H
11 #define STATION_MAP_H
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"
20 typedef uint8_t StationGfx; ///< Index of station graphics. @see _station_display_datas
22 /**
23 * Get StationID from a tile
24 * @param t Tile to query station ID from
25 * @pre IsTileType(t, MP_STATION)
26 * @return Station ID of the station at \a t
28 inline StationID GetStationIndex(Tile t)
30 assert(IsTileType(t, MP_STATION));
31 return (StationID)t.m2();
35 static const int GFX_DOCK_BASE_WATER_PART = 4; ///< The offset for the water parts.
36 static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET = 4; ///< The offset for the drive through parts.
38 /**
39 * Get the station type of this tile
40 * @param t the tile to query
41 * @pre IsTileType(t, MP_STATION)
42 * @return the station type
44 inline StationType GetStationType(Tile t)
46 assert(IsTileType(t, MP_STATION));
47 return (StationType)GB(t.m6(), 3, 4);
50 /**
51 * Get the road stop type of this tile
52 * @param t the tile to query
53 * @pre GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS
54 * @return the road stop type
56 inline RoadStopType GetRoadStopType(Tile t)
58 assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS);
59 return GetStationType(t) == STATION_TRUCK ? ROADSTOP_TRUCK : ROADSTOP_BUS;
62 /**
63 * Get the station graphics of this tile
64 * @param t the tile to query
65 * @pre IsTileType(t, MP_STATION)
66 * @return the station graphics
68 inline StationGfx GetStationGfx(Tile t)
70 assert(IsTileType(t, MP_STATION));
71 return t.m5();
74 /**
75 * Set the station graphics of this tile
76 * @param t the tile to update
77 * @param gfx the new graphics
78 * @pre IsTileType(t, MP_STATION)
80 inline void SetStationGfx(Tile t, StationGfx gfx)
82 assert(IsTileType(t, MP_STATION));
83 t.m5() = gfx;
86 /**
87 * Is this station tile a rail station?
88 * @param t the tile to get the information from
89 * @pre IsTileType(t, MP_STATION)
90 * @return true if and only if the tile is a rail station
92 inline bool IsRailStation(Tile t)
94 return GetStationType(t) == STATION_RAIL;
97 /**
98 * Is this tile a station tile and a rail station?
99 * @param t the tile to get the information from
100 * @return true if and only if the tile is a rail station
102 inline bool IsRailStationTile(Tile t)
104 return IsTileType(t, MP_STATION) && IsRailStation(t);
108 * Is this station tile a rail waypoint?
109 * @param t the tile to get the information from
110 * @pre IsTileType(t, MP_STATION)
111 * @return true if and only if the tile is a rail waypoint
113 inline bool IsRailWaypoint(Tile t)
115 return GetStationType(t) == STATION_WAYPOINT;
119 * Is this tile a station tile and a rail waypoint?
120 * @param t the tile to get the information from
121 * @return true if and only if the tile is a rail waypoint
123 inline bool IsRailWaypointTile(Tile t)
125 return IsTileType(t, MP_STATION) && IsRailWaypoint(t);
129 * Has this station tile a rail? In other words, is this station
130 * tile a rail station or rail waypoint?
131 * @param t the tile to check
132 * @pre IsTileType(t, MP_STATION)
133 * @return true if and only if the tile has rail
135 inline bool HasStationRail(Tile t)
137 return IsRailStation(t) || IsRailWaypoint(t);
141 * Has this station tile a rail? In other words, is this station
142 * tile a rail station or rail waypoint?
143 * @param t the tile to check
144 * @return true if and only if the tile is a station tile and has rail
146 inline bool HasStationTileRail(Tile t)
148 return IsTileType(t, MP_STATION) && HasStationRail(t);
152 * Is this station tile an airport?
153 * @param t the tile to get the information from
154 * @pre IsTileType(t, MP_STATION)
155 * @return true if and only if the tile is an airport
157 inline bool IsAirport(Tile t)
159 return GetStationType(t) == STATION_AIRPORT;
163 * Is this tile a station tile and an airport tile?
164 * @param t the tile to get the information from
165 * @return true if and only if the tile is an airport
167 inline bool IsAirportTile(Tile t)
169 return IsTileType(t, MP_STATION) && IsAirport(t);
172 bool IsHangar(Tile t);
175 * Is the station at \a t a truck stop?
176 * @param t Tile to check
177 * @pre IsTileType(t, MP_STATION)
178 * @return \c true if station is a truck stop, \c false otherwise
180 inline bool IsTruckStop(Tile t)
182 return GetStationType(t) == STATION_TRUCK;
186 * Is the station at \a t a bus stop?
187 * @param t Tile to check
188 * @pre IsTileType(t, MP_STATION)
189 * @return \c true if station is a bus stop, \c false otherwise
191 inline bool IsBusStop(Tile t)
193 return GetStationType(t) == STATION_BUS;
197 * Is the station at \a t a road waypoint?
198 * @param t Tile to check
199 * @pre IsTileType(t, MP_STATION)
200 * @return \c true if station is a road waypoint, \c false otherwise
202 inline bool IsRoadWaypoint(Tile t)
204 return GetStationType(t) == STATION_ROADWAYPOINT;
208 * Is this tile a station tile and a road waypoint?
209 * @param t the tile to get the information from
210 * @return true if and only if the tile is a road waypoint
212 inline bool IsRoadWaypointTile(Tile t)
214 return IsTileType(t, MP_STATION) && IsRoadWaypoint(t);
218 * Is the station at \a t a road station?
219 * @param t Tile to check
220 * @pre IsTileType(t, MP_STATION)
221 * @return \c true if station at the tile is a bus stop or a truck stop, \c false otherwise
223 inline bool IsStationRoadStop(Tile t)
225 assert(IsTileType(t, MP_STATION));
226 return IsTruckStop(t) || IsBusStop(t);
230 * Is tile \a t a road stop station?
231 * @param t Tile to check
232 * @return \c true if the tile is a station tile and a station road stop
234 inline bool IsStationRoadStopTile(Tile t)
236 return IsTileType(t, MP_STATION) && IsStationRoadStop(t);
240 * Is the station at \a t a road station?
241 * @param t Tile to check
242 * @pre IsTileType(t, MP_STATION)
243 * @return \c true if station at the tile is a bus stop, truck stop or road waypoint, \c false otherwise
245 inline bool IsAnyRoadStop(Tile t)
247 assert(IsTileType(t, MP_STATION));
248 return IsTruckStop(t) || IsBusStop(t) || IsRoadWaypoint(t);
252 * Is tile \a t a road stop station?
253 * @param t Tile to check
254 * @return \c true if the tile is a station tile and any road stop type (bus stop, truck stop or road waypoint)
256 inline bool IsAnyRoadStopTile(Tile t)
258 return IsTileType(t, MP_STATION) && IsAnyRoadStop(t);
262 * Is tile \a t a bay (non-drive through) road stop station?
263 * @param t Tile to check
264 * @return \c true if the tile is a station tile and a bay road stop
266 inline bool IsBayRoadStopTile(Tile t)
268 return IsStationRoadStopTile(t) && GetStationGfx(t) < GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET;
272 * Is tile \a t a drive through road stop station or waypoint?
273 * @param t Tile to check
274 * @return \c true if the tile is a station tile and a drive through road stop or road waypoint
276 inline bool IsDriveThroughStopTile(Tile t)
278 return IsAnyRoadStopTile(t) && GetStationGfx(t) >= GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET;
281 StationGfx GetTranslatedAirportTileID(StationGfx gfx);
284 * Get the decorations of a road waypoint.
285 * @param tile The tile to query.
286 * @return The road decoration of the tile.
288 static inline Roadside GetRoadWaypointRoadside(Tile tile)
290 assert(IsRoadWaypointTile(tile));
291 return (Roadside)GB(tile.m3(), 2, 2);
295 * Set the decorations of a road waypoint.
296 * @param tile The tile to change.
297 * @param s The new road decoration of the tile.
299 static inline void SetRoadWaypointRoadside(Tile tile, Roadside s)
301 assert(IsRoadWaypointTile(tile));
302 SB(tile.m3(), 2, 2, s);
306 * Check if a road waypoint tile has snow/desert.
307 * @param t The tile to query.
308 * @return True if the tile has snow/desert.
310 static inline bool IsRoadWaypointOnSnowOrDesert(Tile t)
312 assert(IsRoadWaypointTile(t));
313 return HasBit(t.m8(), 15);
317 * Toggle the snow/desert state of a road waypoint tile.
318 * @param t The tile to change.
320 static inline void ToggleRoadWaypointOnSnowOrDesert(Tile t)
322 assert(IsRoadWaypointTile(t));
323 ToggleBit(t.m8(), 15);
327 * Get the station graphics of this airport tile
328 * @param t the tile to query
329 * @pre IsAirport(t)
330 * @return the station graphics
332 inline StationGfx GetAirportGfx(Tile t)
334 assert(IsAirport(t));
335 return GetTranslatedAirportTileID(GetStationGfx(t));
339 * Gets the direction the bay road stop entrance points towards.
340 * @param t the tile of the road stop
341 * @pre IsBayRoadStopTile(t)
342 * @return the direction of the entrance
344 inline DiagDirection GetBayRoadStopDir(Tile t)
346 assert(IsBayRoadStopTile(t));
347 return static_cast<DiagDirection>(GetStationGfx(t));
351 * Gets the axis of the drive through stop.
352 * @param t the tile of the road stop
353 * @pre IsDriveThroughStopTile(t)
354 * @return the axis the drive through is in
356 inline Axis GetDriveThroughStopAxis(Tile t)
358 assert(IsDriveThroughStopTile(t));
359 return static_cast<Axis>(GetStationGfx(t) - GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET);
363 * Is tile \a t part of an oilrig?
364 * @param t Tile to check
365 * @pre IsTileType(t, MP_STATION)
366 * @return \c true if the tile is an oilrig tile
368 inline bool IsOilRig(Tile t)
370 return GetStationType(t) == STATION_OILRIG;
374 * Is tile \a t a dock tile?
375 * @param t Tile to check
376 * @pre IsTileType(t, MP_STATION)
377 * @return \c true if the tile is a dock
379 inline bool IsDock(Tile t)
381 return GetStationType(t) == STATION_DOCK;
385 * Is tile \a t a dock tile?
386 * @param t Tile to check
387 * @return \c true if the tile is a dock
389 inline bool IsDockTile(Tile t)
391 return IsTileType(t, MP_STATION) && GetStationType(t) == STATION_DOCK;
395 * Is tile \a t a buoy tile?
396 * @param t Tile to check
397 * @pre IsTileType(t, MP_STATION)
398 * @return \c true if the tile is a buoy
400 inline bool IsBuoy(Tile t)
402 return GetStationType(t) == STATION_BUOY;
406 * Is tile \a t a buoy tile?
407 * @param t Tile to check
408 * @return \c true if the tile is a buoy
410 inline bool IsBuoyTile(Tile t)
412 return IsTileType(t, MP_STATION) && IsBuoy(t);
416 * Is tile \a t an hangar tile?
417 * @param t Tile to check
418 * @return \c true if the tile is an hangar
420 inline bool IsHangarTile(Tile t)
422 return IsTileType(t, MP_STATION) && IsHangar(t);
426 * Is tile \a t a blocked tile?
427 * @pre HasStationRail(t)
428 * @param t Tile to check
429 * @return \c true if the tile is blocked
431 inline bool IsStationTileBlocked(Tile t)
433 assert(HasStationRail(t));
434 return HasBit(t.m3(), 0);
438 * Set the blocked state of the rail station
439 * @pre HasStationRail(t)
440 * @param t the station tile
441 * @param b the blocked state
443 inline void SetStationTileBlocked(Tile t, bool b)
445 assert(HasStationRail(t));
446 AssignBit(t.m3(), 0, b);
450 * Can tile \a t have catenary wires?
451 * @pre HasStationRail(t)
452 * @param t Tile to check
453 * @return \c true if the tile can have catenary wires
455 inline bool CanStationTileHaveWires(Tile t)
457 assert(HasStationRail(t));
458 return HasBit(t.m3(), 1);
462 * Set the catenary wires state of the rail station
463 * @pre HasStationRail(t)
464 * @param t the station tile
465 * @param b the catenary wires state
467 inline void SetStationTileHaveWires(Tile t, bool b)
469 assert(HasStationRail(t));
470 AssignBit(t.m3(), 1, b);
474 * Can tile \a t have catenary pylons?
475 * @pre HasStationRail(t)
476 * @param t Tile to check
477 * @return \c true if the tile can have catenary pylons
479 inline bool CanStationTileHavePylons(Tile t)
481 assert(HasStationRail(t));
482 return HasBit(t.m3(), 2);
486 * Set the catenary pylon state of the rail station
487 * @pre HasStationRail(t)
488 * @param t the station tile
489 * @param b the catenary pylons state
491 inline void SetStationTileHavePylons(Tile t, bool b)
493 assert(HasStationRail(t));
494 AssignBit(t.m3(), 2, b);
498 * Get the rail direction of a rail station.
499 * @param t Tile to query
500 * @pre HasStationRail(t)
501 * @return The direction of the rails on tile \a t.
503 inline Axis GetRailStationAxis(Tile t)
505 assert(HasStationRail(t));
506 return HasBit(GetStationGfx(t), 0) ? AXIS_Y : AXIS_X;
510 * Get the rail track of a rail station tile.
511 * @param t Tile to query
512 * @pre HasStationRail(t)
513 * @return The rail track of the rails on tile \a t.
515 inline Track GetRailStationTrack(Tile t)
517 return AxisToTrack(GetRailStationAxis(t));
521 * Get the trackbits of a rail station tile.
522 * @param t Tile to query
523 * @pre HasStationRail(t)
524 * @return The trackbits of the rails on tile \a t.
526 inline TrackBits GetRailStationTrackBits(Tile t)
528 return AxisToTrackBits(GetRailStationAxis(t));
532 * Check if a tile is a valid continuation to a railstation tile.
533 * The tile \a test_tile is a valid continuation to \a station_tile, if all of the following are true:
534 * \li \a test_tile is a rail station tile
535 * \li the railtype of \a test_tile is compatible with the railtype of \a station_tile
536 * \li the tracks on \a test_tile and \a station_tile are in the same direction
537 * \li both tiles belong to the same station
538 * \li \a test_tile is not blocked (@see IsStationTileBlocked)
539 * @param test_tile Tile to test
540 * @param station_tile Station tile to compare with
541 * @pre IsRailStationTile(station_tile)
542 * @return true if the two tiles are compatible
544 inline bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
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);
554 * Get the reservation state of the rail station
555 * @pre HasStationRail(t)
556 * @param t the station tile
557 * @return reservation state
559 inline bool HasStationReservation(Tile t)
561 assert(HasStationRail(t));
562 return HasBit(t.m6(), 2);
566 * Set the reservation state of the rail station
567 * @pre HasStationRail(t)
568 * @param t the station tile
569 * @param b the reservation state
571 inline void SetRailStationReservation(Tile t, bool b)
573 assert(HasStationRail(t));
574 AssignBit(t.m6(), 2, b);
578 * Get the reserved track bits for a waypoint
579 * @pre HasStationRail(t)
580 * @param t the tile
581 * @return reserved track bits
583 inline TrackBits GetStationReservationTrackBits(Tile t)
585 return HasStationReservation(t) ? GetRailStationTrackBits(t) : TRACK_BIT_NONE;
589 * Get the direction of a dock.
590 * @param t Tile to query
591 * @pre IsDock(t)
592 * @pre \a t is the land part of the dock
593 * @return The direction of the dock on tile \a t.
595 inline DiagDirection GetDockDirection(Tile t)
597 StationGfx gfx = GetStationGfx(t);
598 assert(IsDock(t) && gfx < GFX_DOCK_BASE_WATER_PART);
599 return (DiagDirection)(gfx);
603 * Check whether a dock tile is the tile on water.
605 inline bool IsDockWaterPart(Tile t)
607 assert(IsDockTile(t));
608 StationGfx gfx = GetStationGfx(t);
609 return gfx >= GFX_DOCK_BASE_WATER_PART;
613 * Is there a custom rail station spec on this tile?
614 * @param t Tile to query
615 * @pre HasStationTileRail(t)
616 * @return True if this station is part of a newgrf station.
618 inline bool IsCustomStationSpecIndex(Tile t)
620 assert(HasStationTileRail(t));
621 return t.m4() != 0;
625 * Set the custom station spec for this tile.
626 * @param t Tile to set the stationspec of.
627 * @param specindex The new spec.
628 * @pre HasStationTileRail(t)
630 inline void SetCustomStationSpecIndex(Tile t, uint8_t specindex)
632 assert(HasStationTileRail(t));
633 t.m4() = specindex;
637 * Get the custom station spec for this tile.
638 * @param t Tile to query
639 * @pre HasStationTileRail(t)
640 * @return The custom station spec of this tile.
642 inline uint GetCustomStationSpecIndex(Tile t)
644 assert(HasStationTileRail(t));
645 return t.m4();
649 * Is there a custom road stop spec on this tile?
650 * @param t Tile to query
651 * @pre IsAnyRoadStopTile(t)
652 * @return True if this station is part of a newgrf station.
654 inline bool IsCustomRoadStopSpecIndex(Tile t)
656 assert(IsAnyRoadStopTile(t));
657 return GB(t.m8(), 0, 6) != 0;
661 * Set the custom road stop spec for this tile.
662 * @param t Tile to set the stationspec of.
663 * @param specindex The new spec.
664 * @pre IsAnyRoadStopTile(t)
666 inline void SetCustomRoadStopSpecIndex(Tile t, uint8_t specindex)
668 assert(IsAnyRoadStopTile(t));
669 SB(t.m8(), 0, 6, specindex);
673 * Get the custom road stop spec for this tile.
674 * @param t Tile to query
675 * @pre IsAnyRoadStopTile(t)
676 * @return The custom station spec of this tile.
678 inline uint GetCustomRoadStopSpecIndex(Tile t)
680 assert(IsAnyRoadStopTile(t));
681 return GB(t.m8(), 0, 6);
685 * Set the random bits for a station tile.
686 * @param t Tile to set random bits for.
687 * @param random_bits The random bits.
688 * @pre IsTileType(t, MP_STATION)
690 inline void SetStationTileRandomBits(Tile t, uint8_t random_bits)
692 assert(IsTileType(t, MP_STATION));
693 SB(t.m3(), 4, 4, random_bits);
697 * Get the random bits of a station tile.
698 * @param t Tile to query
699 * @pre IsTileType(t, MP_STATION)
700 * @return The random bits for this station tile.
702 inline uint8_t GetStationTileRandomBits(Tile t)
704 assert(IsTileType(t, MP_STATION));
705 return GB(t.m3(), 4, 4);
709 * Make the given tile a station tile.
710 * @param t the tile to make a station tile
711 * @param o the owner of the station
712 * @param sid the station to which this tile belongs
713 * @param st the type this station tile
714 * @param section the StationGfx to be used for this tile
715 * @param wc The water class of the station
717 inline void MakeStation(Tile t, Owner o, StationID sid, StationType st, uint8_t section, WaterClass wc = WATER_CLASS_INVALID)
719 SetTileType(t, MP_STATION);
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;
734 * Make the given tile a rail station tile.
735 * @param t the tile to make a rail station tile
736 * @param o the owner of the station
737 * @param sid the station to which this tile belongs
738 * @param a the axis of this tile
739 * @param section the StationGfx to be used for this tile
740 * @param rt the railtype of this tile
742 inline void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
744 MakeStation(t, o, sid, STATION_RAIL, section + a);
745 SetRailType(t, rt);
746 SetRailStationReservation(t, false);
750 * Make the given tile a rail waypoint tile.
751 * @param t the tile to make a rail waypoint
752 * @param o the owner of the waypoint
753 * @param sid the waypoint to which this tile belongs
754 * @param a the axis of this tile
755 * @param section the StationGfx to be used for this tile
756 * @param rt the railtype of this tile
758 inline void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
760 MakeStation(t, o, sid, STATION_WAYPOINT, section + a);
761 SetRailType(t, rt);
762 SetRailStationReservation(t, false);
766 * Make the given tile a roadstop tile.
767 * @param t the tile to make a roadstop
768 * @param o the owner of the roadstop
769 * @param sid the station to which this tile belongs
770 * @param rst the type of roadstop to make this tile
771 * @param road_rt the road roadtype on this tile
772 * @param tram_rt the tram roadtype on this tile
773 * @param d the direction of the roadstop
775 inline void MakeRoadStop(Tile t, Owner o, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, DiagDirection d)
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);
784 * Make the given tile a drivethrough roadstop tile.
785 * @param t the tile to make a roadstop
786 * @param station the owner of the roadstop
787 * @param road the owner of the road
788 * @param tram the owner of the tram
789 * @param sid the station to which this tile belongs
790 * @param rst the type of roadstop to make this tile
791 * @param road_rt the road roadtype on this tile
792 * @param tram_rt the tram roadtype on this tile
793 * @param a the direction of the roadstop
795 inline void MakeDriveThroughRoadStop(Tile t, Owner station, Owner road, Owner tram, StationID sid, StationType rst, RoadType road_rt, RoadType tram_rt, Axis a)
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);
804 * Make the given tile an airport tile.
805 * @param t the tile to make a airport
806 * @param o the owner of the airport
807 * @param sid the station to which this tile belongs
808 * @param section the StationGfx to be used for this tile
809 * @param wc the type of water on this tile
811 inline void MakeAirport(Tile t, Owner o, StationID sid, uint8_t section, WaterClass wc)
813 MakeStation(t, o, sid, STATION_AIRPORT, section, wc);
817 * Make the given tile a buoy tile.
818 * @param t the tile to make a buoy
819 * @param sid the station to which this tile belongs
820 * @param wc the type of water on this tile
822 inline void MakeBuoy(Tile t, StationID sid, WaterClass wc)
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);
831 * Make the given tile a dock tile.
832 * @param t the tile to make a dock
833 * @param o the owner of the dock
834 * @param sid the station to which this tile belongs
835 * @param d the direction of the dock
836 * @param wc the type of water on this tile
838 inline void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
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);
845 * Make the given tile an oilrig tile.
846 * @param t the tile to make an oilrig
847 * @param sid the station to which this tile belongs
848 * @param wc the type of water on this tile
850 inline void MakeOilrig(Tile t, StationID sid, WaterClass wc)
852 MakeStation(t, OWNER_NONE, sid, STATION_OILRIG, 0, wc);
855 #endif /* STATION_MAP_H */