Update: Translations from eints
[openttd-github.git] / src / station_map.h
blobb4dad48986134ab2712c86e23675906ae3626703
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 road stop entrance points towards.
340 * @param t the tile of the road stop
341 * @pre IsAnyRoadStopTile(t)
342 * @return the direction of the entrance
344 inline DiagDirection GetRoadStopDir(Tile t)
346 StationGfx gfx = GetStationGfx(t);
347 assert(IsAnyRoadStopTile(t));
348 if (gfx < GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET) {
349 return (DiagDirection)(gfx);
350 } else {
351 return (DiagDirection)(gfx - GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET);
356 * Is tile \a t part of an oilrig?
357 * @param t Tile to check
358 * @pre IsTileType(t, MP_STATION)
359 * @return \c true if the tile is an oilrig tile
361 inline bool IsOilRig(Tile t)
363 return GetStationType(t) == STATION_OILRIG;
367 * Is tile \a t a dock tile?
368 * @param t Tile to check
369 * @pre IsTileType(t, MP_STATION)
370 * @return \c true if the tile is a dock
372 inline bool IsDock(Tile t)
374 return GetStationType(t) == STATION_DOCK;
378 * Is tile \a t a dock tile?
379 * @param t Tile to check
380 * @return \c true if the tile is a dock
382 inline bool IsDockTile(Tile t)
384 return IsTileType(t, MP_STATION) && GetStationType(t) == STATION_DOCK;
388 * Is tile \a t a buoy tile?
389 * @param t Tile to check
390 * @pre IsTileType(t, MP_STATION)
391 * @return \c true if the tile is a buoy
393 inline bool IsBuoy(Tile t)
395 return GetStationType(t) == STATION_BUOY;
399 * Is tile \a t a buoy tile?
400 * @param t Tile to check
401 * @return \c true if the tile is a buoy
403 inline bool IsBuoyTile(Tile t)
405 return IsTileType(t, MP_STATION) && IsBuoy(t);
409 * Is tile \a t an hangar tile?
410 * @param t Tile to check
411 * @return \c true if the tile is an hangar
413 inline bool IsHangarTile(Tile t)
415 return IsTileType(t, MP_STATION) && IsHangar(t);
419 * Is tile \a t a blocked tile?
420 * @pre HasStationRail(t)
421 * @param t Tile to check
422 * @return \c true if the tile is blocked
424 inline bool IsStationTileBlocked(Tile t)
426 assert(HasStationRail(t));
427 return HasBit(t.m6(), 0);
431 * Set the blocked state of the rail station
432 * @pre HasStationRail(t)
433 * @param t the station tile
434 * @param b the blocked state
436 inline void SetStationTileBlocked(Tile t, bool b)
438 assert(HasStationRail(t));
439 AssignBit(t.m6(), 0, b);
443 * Can tile \a t have catenary wires?
444 * @pre HasStationRail(t)
445 * @param t Tile to check
446 * @return \c true if the tile can have catenary wires
448 inline bool CanStationTileHaveWires(Tile t)
450 assert(HasStationRail(t));
451 return HasBit(t.m6(), 1);
455 * Set the catenary wires state of the rail station
456 * @pre HasStationRail(t)
457 * @param t the station tile
458 * @param b the catenary wires state
460 inline void SetStationTileHaveWires(Tile t, bool b)
462 assert(HasStationRail(t));
463 AssignBit(t.m6(), 1, b);
467 * Can tile \a t have catenary pylons?
468 * @pre HasStationRail(t)
469 * @param t Tile to check
470 * @return \c true if the tile can have catenary pylons
472 inline bool CanStationTileHavePylons(Tile t)
474 assert(HasStationRail(t));
475 return HasBit(t.m6(), 7);
479 * Set the catenary pylon state of the rail station
480 * @pre HasStationRail(t)
481 * @param t the station tile
482 * @param b the catenary pylons state
484 inline void SetStationTileHavePylons(Tile t, bool b)
486 assert(HasStationRail(t));
487 AssignBit(t.m6(), 7, b);
491 * Get the rail direction of a rail station.
492 * @param t Tile to query
493 * @pre HasStationRail(t)
494 * @return The direction of the rails on tile \a t.
496 inline Axis GetRailStationAxis(Tile t)
498 assert(HasStationRail(t));
499 return HasBit(GetStationGfx(t), 0) ? AXIS_Y : AXIS_X;
503 * Get the rail track of a rail station tile.
504 * @param t Tile to query
505 * @pre HasStationRail(t)
506 * @return The rail track of the rails on tile \a t.
508 inline Track GetRailStationTrack(Tile t)
510 return AxisToTrack(GetRailStationAxis(t));
514 * Get the trackbits of a rail station tile.
515 * @param t Tile to query
516 * @pre HasStationRail(t)
517 * @return The trackbits of the rails on tile \a t.
519 inline TrackBits GetRailStationTrackBits(Tile t)
521 return AxisToTrackBits(GetRailStationAxis(t));
525 * Check if a tile is a valid continuation to a railstation tile.
526 * The tile \a test_tile is a valid continuation to \a station_tile, if all of the following are true:
527 * \li \a test_tile is a rail station tile
528 * \li the railtype of \a test_tile is compatible with the railtype of \a station_tile
529 * \li the tracks on \a test_tile and \a station_tile are in the same direction
530 * \li both tiles belong to the same station
531 * \li \a test_tile is not blocked (@see IsStationTileBlocked)
532 * @param test_tile Tile to test
533 * @param station_tile Station tile to compare with
534 * @pre IsRailStationTile(station_tile)
535 * @return true if the two tiles are compatible
537 inline bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
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);
547 * Get the reservation state of the rail station
548 * @pre HasStationRail(t)
549 * @param t the station tile
550 * @return reservation state
552 inline bool HasStationReservation(Tile t)
554 assert(HasStationRail(t));
555 return HasBit(t.m6(), 2);
559 * Set the reservation state of the rail station
560 * @pre HasStationRail(t)
561 * @param t the station tile
562 * @param b the reservation state
564 inline void SetRailStationReservation(Tile t, bool b)
566 assert(HasStationRail(t));
567 AssignBit(t.m6(), 2, b);
571 * Get the reserved track bits for a waypoint
572 * @pre HasStationRail(t)
573 * @param t the tile
574 * @return reserved track bits
576 inline TrackBits GetStationReservationTrackBits(Tile t)
578 return HasStationReservation(t) ? GetRailStationTrackBits(t) : TRACK_BIT_NONE;
582 * Get the direction of a dock.
583 * @param t Tile to query
584 * @pre IsDock(t)
585 * @pre \a t is the land part of the dock
586 * @return The direction of the dock on tile \a t.
588 inline DiagDirection GetDockDirection(Tile t)
590 StationGfx gfx = GetStationGfx(t);
591 assert(IsDock(t) && gfx < GFX_DOCK_BASE_WATER_PART);
592 return (DiagDirection)(gfx);
596 * Check whether a dock tile is the tile on water.
598 inline bool IsDockWaterPart(Tile t)
600 assert(IsDockTile(t));
601 StationGfx gfx = GetStationGfx(t);
602 return gfx >= GFX_DOCK_BASE_WATER_PART;
606 * Is there a custom rail station spec on this tile?
607 * @param t Tile to query
608 * @pre HasStationTileRail(t)
609 * @return True if this station is part of a newgrf station.
611 inline bool IsCustomStationSpecIndex(Tile t)
613 assert(HasStationTileRail(t));
614 return t.m4() != 0;
618 * Set the custom station spec for this tile.
619 * @param t Tile to set the stationspec of.
620 * @param specindex The new spec.
621 * @pre HasStationTileRail(t)
623 inline void SetCustomStationSpecIndex(Tile t, uint8_t specindex)
625 assert(HasStationTileRail(t));
626 t.m4() = specindex;
630 * Get the custom station spec for this tile.
631 * @param t Tile to query
632 * @pre HasStationTileRail(t)
633 * @return The custom station spec of this tile.
635 inline uint GetCustomStationSpecIndex(Tile t)
637 assert(HasStationTileRail(t));
638 return t.m4();
642 * Is there a custom road stop spec on this tile?
643 * @param t Tile to query
644 * @pre IsAnyRoadStopTile(t)
645 * @return True if this station is part of a newgrf station.
647 inline bool IsCustomRoadStopSpecIndex(Tile t)
649 assert(IsAnyRoadStopTile(t));
650 return GB(t.m8(), 0, 6) != 0;
654 * Set the custom road stop spec for this tile.
655 * @param t Tile to set the stationspec of.
656 * @param specindex The new spec.
657 * @pre IsAnyRoadStopTile(t)
659 inline void SetCustomRoadStopSpecIndex(Tile t, uint8_t specindex)
661 assert(IsAnyRoadStopTile(t));
662 SB(t.m8(), 0, 6, specindex);
666 * Get the custom road stop spec for this tile.
667 * @param t Tile to query
668 * @pre IsAnyRoadStopTile(t)
669 * @return The custom station spec of this tile.
671 inline uint GetCustomRoadStopSpecIndex(Tile t)
673 assert(IsAnyRoadStopTile(t));
674 return GB(t.m8(), 0, 6);
678 * Set the random bits for a station tile.
679 * @param t Tile to set random bits for.
680 * @param random_bits The random bits.
681 * @pre IsTileType(t, MP_STATION)
683 inline void SetStationTileRandomBits(Tile t, uint8_t random_bits)
685 assert(IsTileType(t, MP_STATION));
686 SB(t.m3(), 4, 4, random_bits);
690 * Get the random bits of a station tile.
691 * @param t Tile to query
692 * @pre IsTileType(t, MP_STATION)
693 * @return The random bits for this station tile.
695 inline uint8_t GetStationTileRandomBits(Tile t)
697 assert(IsTileType(t, MP_STATION));
698 return GB(t.m3(), 4, 4);
702 * Make the given tile a station tile.
703 * @param t the tile to make a station tile
704 * @param o the owner of the station
705 * @param sid the station to which this tile belongs
706 * @param st the type this station tile
707 * @param section the StationGfx to be used for this tile
708 * @param wc The water class of the station
710 inline void MakeStation(Tile t, Owner o, StationID sid, StationType st, uint8_t section, WaterClass wc = WATER_CLASS_INVALID)
712 SetTileType(t, MP_STATION);
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;
727 * Make the given tile a rail station tile.
728 * @param t the tile to make a rail station tile
729 * @param o the owner of the station
730 * @param sid the station to which this tile belongs
731 * @param a the axis of this tile
732 * @param section the StationGfx to be used for this tile
733 * @param rt the railtype of this tile
735 inline void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
737 MakeStation(t, o, sid, STATION_RAIL, section + a);
738 SetRailType(t, rt);
739 SetRailStationReservation(t, false);
743 * Make the given tile a rail waypoint tile.
744 * @param t the tile to make a rail waypoint
745 * @param o the owner of the waypoint
746 * @param sid the waypoint to which this tile belongs
747 * @param a the axis of this tile
748 * @param section the StationGfx to be used for this tile
749 * @param rt the railtype of this tile
751 inline void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
753 MakeStation(t, o, sid, STATION_WAYPOINT, section + a);
754 SetRailType(t, rt);
755 SetRailStationReservation(t, false);
759 * Make the given tile a roadstop tile.
760 * @param t the tile to make a roadstop
761 * @param o the owner of the roadstop
762 * @param sid the station to which this tile belongs
763 * @param rst the type of roadstop to make this tile
764 * @param road_rt the road roadtype on this tile
765 * @param tram_rt the tram roadtype on this tile
766 * @param d the direction of the roadstop
768 inline void MakeRoadStop(Tile t, Owner o, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, DiagDirection d)
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);
777 * Make the given tile a drivethrough roadstop tile.
778 * @param t the tile to make a roadstop
779 * @param station the owner of the roadstop
780 * @param road the owner of the road
781 * @param tram the owner of the tram
782 * @param sid the station to which this tile belongs
783 * @param rst the type of roadstop to make this tile
784 * @param road_rt the road roadtype on this tile
785 * @param tram_rt the tram roadtype on this tile
786 * @param a the direction of the roadstop
788 inline void MakeDriveThroughRoadStop(Tile t, Owner station, Owner road, Owner tram, StationID sid, StationType rst, RoadType road_rt, RoadType tram_rt, Axis a)
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);
797 * Make the given tile an airport tile.
798 * @param t the tile to make a airport
799 * @param o the owner of the airport
800 * @param sid the station to which this tile belongs
801 * @param section the StationGfx to be used for this tile
802 * @param wc the type of water on this tile
804 inline void MakeAirport(Tile t, Owner o, StationID sid, uint8_t section, WaterClass wc)
806 MakeStation(t, o, sid, STATION_AIRPORT, section, wc);
810 * Make the given tile a buoy tile.
811 * @param t the tile to make a buoy
812 * @param sid the station to which this tile belongs
813 * @param wc the type of water on this tile
815 inline void MakeBuoy(Tile t, StationID sid, WaterClass wc)
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);
824 * Make the given tile a dock tile.
825 * @param t the tile to make a dock
826 * @param o the owner of the dock
827 * @param sid the station to which this tile belongs
828 * @param d the direction of the dock
829 * @param wc the type of water on this tile
831 inline void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
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);
838 * Make the given tile an oilrig tile.
839 * @param t the tile to make an oilrig
840 * @param sid the station to which this tile belongs
841 * @param wc the type of water on this tile
843 inline void MakeOilrig(Tile t, StationID sid, WaterClass wc)
845 MakeStation(t, OWNER_NONE, sid, STATION_OILRIG, 0, wc);
848 #endif /* STATION_MAP_H */