src/station_map.h
author rubidium
Thu, 18 Dec 2008 12:23:08 +0000
changeset 10436 8d3a9fbe8f19
parent 10260 c6ec6b3c1b18
permissions -rw-r--r--
(svn r14689) -Change: make configure die on commonly made user mistakes, like not having SDL development files or zlib headers installed; you can still compile a dedicated server or a binary without zlib, but you have to explicitly force it.
3315
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
     1
/* $Id$ */
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
     2
9111
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8955
diff changeset
     3
/** @file station_map.h Maps accessors for stations. */
6420
456c275f3313 (svn r9556) -Documentation: doxygen and comment-style changes. 'R', 'S'.. The end of the preliminary work is near
belugas
parents: 6248
diff changeset
     4
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
     5
#ifndef STATION_MAP_H
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
     6
#define STATION_MAP_H
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
     7
4041
72276cd8ee2b (svn r5309) Partially fix the rail header dependency fiasco: rail_map.h now depends on rail.h and not the other way round anymore
tron
parents: 3900
diff changeset
     8
#include "rail_map.h"
6661
1716fce5ad29 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6420
diff changeset
     9
#include "road_map.h"
8471
ba4c15fe147b (svn r12042) -Fix [FS#1676]: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be
peter1138
parents: 8422
diff changeset
    10
#include "water_map.h"
8785
871586967963 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents: 8471
diff changeset
    11
#include "station_func.h"
871586967963 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents: 8471
diff changeset
    12
#include "station_base.h"
8138
dbfdc08fa6b9 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents: 7928
diff changeset
    13
#include "rail.h"
3315
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    14
3545
b08ce1bbb589 (svn r4411) CodeChange : Define and use some Gfx for both stations and industries. More are still to come
belugas
parents: 3541
diff changeset
    15
typedef byte StationGfx;
b08ce1bbb589 (svn r4411) CodeChange : Define and use some Gfx for both stations and industries. More are still to come
belugas
parents: 3541
diff changeset
    16
10260
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
    17
/** Get Station ID from a tile
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
    18
 * @pre Tile \t must be part of the station
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
    19
 * @param t Tile to query station ID from
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
    20
 * @return Station ID of the station at \a t */
3315
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    21
static inline StationID GetStationIndex(TileIndex t)
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    22
{
3369
cab209754317 (svn r4166) Sprinkle several map accessors with assert()s
tron
parents: 3360
diff changeset
    23
	assert(IsTileType(t, MP_STATION));
3315
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    24
	return (StationID)_m[t].m2;
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    25
}
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    26
7318
632cd0497770 (svn r10673) -Cleanup: some assorted style cleanups. Primarily type* var -> type *var.
rubidium
parents: 7272
diff changeset
    27
static inline Station *GetStationByTile(TileIndex t)
3315
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    28
{
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    29
	return GetStation(GetStationIndex(t));
c9d989783c55 (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff changeset
    30
}
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    31
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    32
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    33
enum {
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    34
	GFX_RADAR_LARGE_FIRST             =  31,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    35
	GFX_RADAR_LARGE_LAST              =  42,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    36
	GFX_WINDSACK_FIRST                =  50,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    37
	GFX_WINDSACK_LAST                 =  53,
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    38
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    39
	GFX_DOCK_BASE_WATER_PART          =  4,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    40
	GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET =  4,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    41
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    42
	GFX_RADAR_INTERNATIONAL_FIRST     =  66,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    43
	GFX_RADAR_INTERNATIONAL_LAST      =  77,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    44
	GFX_RADAR_METROPOLITAN_FIRST      =  78,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    45
	GFX_RADAR_METROPOLITAN_LAST       =  89,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    46
	GFX_RADAR_DISTRICTWE_FIRST        = 121,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    47
	GFX_RADAR_DISTRICTWE_LAST         = 132,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    48
	GFX_WINDSACK_INTERCON_FIRST       = 140,
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    49
	GFX_WINDSACK_INTERCON_LAST        = 143,
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    50
};
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    51
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    52
static inline StationType GetStationType(TileIndex t)
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    53
{
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    54
	return (StationType)GB(_m[t].m6, 3, 3);
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    55
}
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    56
8785
871586967963 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents: 8471
diff changeset
    57
static inline RoadStopType GetRoadStopType(TileIndex t)
3360
4fddbd48d36c (svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents: 3353
diff changeset
    58
{
4fddbd48d36c (svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents: 3353
diff changeset
    59
	assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS);
8785
871586967963 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents: 8471
diff changeset
    60
	return GetStationType(t) == STATION_TRUCK ? ROADSTOP_TRUCK : ROADSTOP_BUS;
3360
4fddbd48d36c (svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents: 3353
diff changeset
    61
}
4fddbd48d36c (svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents: 3353
diff changeset
    62
3545
b08ce1bbb589 (svn r4411) CodeChange : Define and use some Gfx for both stations and industries. More are still to come
belugas
parents: 3541
diff changeset
    63
static inline StationGfx GetStationGfx(TileIndex t)
3540
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    64
{
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    65
	assert(IsTileType(t, MP_STATION));
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    66
	return _m[t].m5;
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    67
}
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    68
3545
b08ce1bbb589 (svn r4411) CodeChange : Define and use some Gfx for both stations and industries. More are still to come
belugas
parents: 3541
diff changeset
    69
static inline void SetStationGfx(TileIndex t, StationGfx gfx)
3540
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    70
{
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    71
	assert(IsTileType(t, MP_STATION));
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    72
	_m[t].m5 = gfx;
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    73
}
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
    74
8955
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    75
static inline uint8 GetStationAnimationFrame(TileIndex t)
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    76
{
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    77
	assert(IsTileType(t, MP_STATION));
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    78
	return _me[t].m7;
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    79
}
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    80
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    81
static inline void SetStationAnimationFrame(TileIndex t, uint8 frame)
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    82
{
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    83
	assert(IsTileType(t, MP_STATION));
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    84
	_me[t].m7 = frame;
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    85
}
701809dd5b33 (svn r12746) -Codechange: Add map storage for station animation frame
peter1138
parents: 8787
diff changeset
    86
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    87
static inline bool IsRailwayStation(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    88
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    89
	return GetStationType(t) == STATION_RAIL;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    90
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
    91
3442
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
    92
static inline bool IsRailwayStationTile(TileIndex t)
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
    93
{
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
    94
	return IsTileType(t, MP_STATION) && IsRailwayStation(t);
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
    95
}
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
    96
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    97
static inline bool IsAirport(TileIndex t)
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    98
{
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
    99
	return GetStationType(t) == STATION_AIRPORT;
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   100
}
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   101
7320
96d5862ec06a (svn r10681) -Codechange: do not determine whether a tile is a hangar based on the graphics index to be drawn on the given tile, but do it based on the specification of the location of hangars of the airport.
rubidium
parents: 7318
diff changeset
   102
bool IsHangar(TileIndex t);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   103
10260
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   104
/**
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   105
 * Is the station at \a t a truck stop?
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   106
 * @param t Tile to check
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   107
 * @return \c true if station is a truck stop, \c false otherwise */
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   108
static inline bool IsTruckStop(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   109
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   110
	return GetStationType(t) == STATION_TRUCK;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   111
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   112
10260
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   113
/**
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   114
 * Is the station at \a t a bus stop?
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   115
 * @param t Tile to check
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   116
 * @return \c true if station is a bus stop, \c false otherwise */
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   117
static inline bool IsBusStop(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   118
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   119
	return GetStationType(t) == STATION_BUS;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   120
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   121
10260
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   122
/**
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   123
 * Is the station at \a t a road station?
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   124
 * @pre Tile at \a t is a station tile
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   125
 * @param t Tile to check
c6ec6b3c1b18 (svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium
parents: 10228
diff changeset
   126
 * @return \c true if station at the tile is a bus top or a truck stop, \c false otherwise */
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   127
static inline bool IsRoadStop(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   128
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   129
	assert(IsTileType(t, MP_STATION));
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   130
	return IsTruckStop(t) || IsBusStop(t);
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   131
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   132
3404
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   133
static inline bool IsRoadStopTile(TileIndex t)
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   134
{
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   135
	return IsTileType(t, MP_STATION) && IsRoadStop(t);
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   136
}
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   137
6012
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   138
static inline bool IsStandardRoadStopTile(TileIndex t)
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   139
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   140
	return IsRoadStopTile(t) && GetStationGfx(t) < GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET;
6012
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   141
}
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   142
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   143
static inline bool IsDriveThroughStopTile(TileIndex t)
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   144
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   145
	return IsRoadStopTile(t) && GetStationGfx(t) >= GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET;
6012
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   146
}
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   147
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   148
static inline bool GetStopBuiltOnTownRoad(TileIndex t)
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   149
{
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   150
	assert(IsDriveThroughStopTile(t));
7928
63e18de69e50 (svn r11481) -Codechange: Rename the HASBIT function to fit with the naming style
skidd13
parents: 7739
diff changeset
   151
	return HasBit(_m[t].m6, 2);
6012
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   152
}
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   153
9342
6daf441eee26 (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9111
diff changeset
   154
static inline void SetStopBuiltOnTownRoad(TileIndex t, bool on_town_road)
6daf441eee26 (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9111
diff changeset
   155
{
6daf441eee26 (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9111
diff changeset
   156
	assert(IsDriveThroughStopTile(t));
6daf441eee26 (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9111
diff changeset
   157
	SB(_m[t].m6, 2, 1, on_town_road);
6daf441eee26 (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9111
diff changeset
   158
}
6daf441eee26 (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9111
diff changeset
   159
6012
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   160
3404
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   161
/**
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   162
 * Gets the direction the road stop entrance points towards.
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   163
 */
3540
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
   164
static inline DiagDirection GetRoadStopDir(TileIndex t)
3404
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   165
{
6012
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   166
	StationGfx gfx = GetStationGfx(t);
3540
3bcf5348842b (svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
belugas
parents: 3474
diff changeset
   167
	assert(IsRoadStopTile(t));
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   168
	if (gfx < GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET) {
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   169
		return (DiagDirection)(gfx);
6012
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   170
	} else {
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   171
		return (DiagDirection)(gfx - GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET);
6012
065d7234a7a9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 5953
diff changeset
   172
	}
3404
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   173
}
eb8ebfe5df67 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents: 3371
diff changeset
   174
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   175
static inline bool IsOilRig(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   176
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   177
	return GetStationType(t) == STATION_OILRIG;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   178
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   179
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   180
static inline bool IsDock(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   181
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   182
	return GetStationType(t) == STATION_DOCK;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   183
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   184
10228
2de09b30921a (svn r14456) -Fix: Obiwan in catchment-area and station-spread of docks.
frosch
parents: 9784
diff changeset
   185
static inline bool IsDockTile(TileIndex t)
2de09b30921a (svn r14456) -Fix: Obiwan in catchment-area and station-spread of docks.
frosch
parents: 9784
diff changeset
   186
{
2de09b30921a (svn r14456) -Fix: Obiwan in catchment-area and station-spread of docks.
frosch
parents: 9784
diff changeset
   187
	return IsTileType(t, MP_STATION) && GetStationType(t) == STATION_DOCK;
2de09b30921a (svn r14456) -Fix: Obiwan in catchment-area and station-spread of docks.
frosch
parents: 9784
diff changeset
   188
}
2de09b30921a (svn r14456) -Fix: Obiwan in catchment-area and station-spread of docks.
frosch
parents: 9784
diff changeset
   189
5905
422a010c5286 (svn r8528) -Codechange: Rename IsBuoy_() to IsBuoy() now that the naming conflict no longer exists.
celestar
parents: 5836
diff changeset
   190
static inline bool IsBuoy(TileIndex t)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   191
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   192
	return GetStationType(t) == STATION_BUOY;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   193
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   194
3442
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
   195
static inline bool IsBuoyTile(TileIndex t)
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
   196
{
5905
422a010c5286 (svn r8528) -Codechange: Rename IsBuoy_() to IsBuoy() now that the naming conflict no longer exists.
celestar
parents: 5836
diff changeset
   197
	return IsTileType(t, MP_STATION) && IsBuoy(t);
3442
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
   198
}
41d828e2d5ab (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents: 3404
diff changeset
   199
3338
7cff208f0446 (svn r4120) Use the new station functions where appropriate
tron
parents: 3337
diff changeset
   200
static inline bool IsHangarTile(TileIndex t)
7cff208f0446 (svn r4120) Use the new station functions where appropriate
tron
parents: 3337
diff changeset
   201
{
7cff208f0446 (svn r4120) Use the new station functions where appropriate
tron
parents: 3337
diff changeset
   202
	return IsTileType(t, MP_STATION) && IsHangar(t);
7cff208f0446 (svn r4120) Use the new station functions where appropriate
tron
parents: 3337
diff changeset
   203
}
7cff208f0446 (svn r4120) Use the new station functions where appropriate
tron
parents: 3337
diff changeset
   204
7cff208f0446 (svn r4120) Use the new station functions where appropriate
tron
parents: 3337
diff changeset
   205
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   206
static inline Axis GetRailStationAxis(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   207
{
3541
de660582cff4 (svn r4404) Reverted part of r4403. GetRailStationAxis need assertion on IsRailwayStation. Thanks glx for spotting it
belugas
parents: 3540
diff changeset
   208
	assert(IsRailwayStation(t));
7928
63e18de69e50 (svn r11481) -Codechange: Rename the HASBIT function to fit with the naming style
skidd13
parents: 7739
diff changeset
   209
	return HasBit(GetStationGfx(t), 0) ? AXIS_Y : AXIS_X;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   210
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   211
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   212
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   213
static inline Track GetRailStationTrack(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   214
{
4158
91ff9bb84ced (svn r5582) Add and use AxisToTrack{Bits,}()
tron
parents: 4136
diff changeset
   215
	return AxisToTrack(GetRailStationAxis(t));
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   216
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   217
3444
80cfd2f70922 (svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents: 3443
diff changeset
   218
static inline bool IsCompatibleTrainStationTile(TileIndex t1, TileIndex t2)
80cfd2f70922 (svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents: 3443
diff changeset
   219
{
80cfd2f70922 (svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents: 3443
diff changeset
   220
	assert(IsRailwayStationTile(t2));
80cfd2f70922 (svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents: 3443
diff changeset
   221
	return
80cfd2f70922 (svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents: 3443
diff changeset
   222
		IsRailwayStationTile(t1) &&
80cfd2f70922 (svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents: 3443
diff changeset
   223
		IsCompatibleRail(GetRailType(t1), GetRailType(t2)) &&
3766
fc2dea6ef369 (svn r4758) - Newstations: add support for 'blocked' station tiles, which no train can pass.
peter1138
parents: 3742
diff changeset
   224
		GetRailStationAxis(t1) == GetRailStationAxis(t2) &&
8422
4643fb49b1c7 (svn r11992) -Fix (r9905): When building two rail stations close to each other (with control) so they looked like one long track trains would see them as one (spotted and fixed by eddi)
bjarni
parents: 8138
diff changeset
   225
		GetStationIndex(t1) == GetStationIndex(t2) &&
3766
fc2dea6ef369 (svn r4758) - Newstations: add support for 'blocked' station tiles, which no train can pass.
peter1138
parents: 3742
diff changeset
   226
		!IsStationTileBlocked(t1);
3444
80cfd2f70922 (svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents: 3443
diff changeset
   227
}
80cfd2f70922 (svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents: 3443
diff changeset
   228
9784
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   229
/**
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   230
 * Get the reservation state of the rail station
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   231
 * @pre IsRailwayStationTile(t)
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   232
 * @param t the station tile
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   233
 * @return reservation state
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   234
 */
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   235
static inline bool GetRailwayStationReservation(TileIndex t)
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   236
{
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   237
	assert(IsRailwayStationTile(t));
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   238
	return HasBit(_m[t].m6, 2);
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   239
}
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   240
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   241
/**
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   242
 * Set the reservation state of the rail station
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   243
 * @pre IsRailwayStationTile(t)
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   244
 * @param t the station tile
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   245
 * @param b the reservation state
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   246
 */
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   247
static inline void SetRailwayStationReservation(TileIndex t, bool b)
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   248
{
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   249
	assert(IsRailwayStationTile(t));
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   250
	SB(_m[t].m6, 2, 1, b ? 1 : 0);
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   251
}
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   252
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   253
/**
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   254
 * Get the reserved track bits for a waypoint
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   255
 * @pre IsRailwayStationTile(t)
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   256
 * @param t the tile
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   257
 * @return reserved track bits
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   258
 */
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   259
static inline TrackBits GetRailStationReservation(TileIndex t)
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   260
{
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   261
	return GetRailwayStationReservation(t) ? AxisToTrackBits(GetRailStationAxis(t)) : TRACK_BIT_NONE;
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   262
}
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   263
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   264
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   265
static inline DiagDirection GetDockDirection(TileIndex t)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   266
{
3545
b08ce1bbb589 (svn r4411) CodeChange : Define and use some Gfx for both stations and industries. More are still to come
belugas
parents: 3541
diff changeset
   267
	StationGfx gfx = GetStationGfx(t);
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   268
	assert(IsDock(t) && gfx < GFX_DOCK_BASE_WATER_PART);
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   269
	return (DiagDirection)(gfx);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   270
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   271
3472
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   272
static inline TileIndexDiffC GetDockOffset(TileIndex t)
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   273
{
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   274
	static const TileIndexDiffC buoy_offset = {0, 0};
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   275
	static const TileIndexDiffC oilrig_offset = {2, 0};
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   276
	static const TileIndexDiffC dock_offset[DIAGDIR_END] = {
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   277
		{-2,  0},
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   278
		{ 0,  2},
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   279
		{ 2,  0},
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   280
		{ 0, -2},
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   281
	};
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   282
	assert(IsTileType(t, MP_STATION));
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   283
5905
422a010c5286 (svn r8528) -Codechange: Rename IsBuoy_() to IsBuoy() now that the naming conflict no longer exists.
celestar
parents: 5836
diff changeset
   284
	if (IsBuoy(t)) return buoy_offset;
3472
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   285
	if (IsOilRig(t)) return oilrig_offset;
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   286
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   287
	assert(IsDock(t));
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   288
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   289
	return dock_offset[GetDockDirection(t)];
04173b5ed0d2 (svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents: 3444
diff changeset
   290
}
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   291
3568
c60d7aceed1a (svn r4450) - NewStations, rename *CustomStationSprite() to *CustomStationSpecIndex() to reflect their use, and alter the test for determining if a station has customised graphics.
peter1138
parents: 3545
diff changeset
   292
static inline bool IsCustomStationSpecIndex(TileIndex t)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   293
{
3369
cab209754317 (svn r4166) Sprinkle several map accessors with assert()s
tron
parents: 3360
diff changeset
   294
	assert(IsTileType(t, MP_STATION));
3568
c60d7aceed1a (svn r4450) - NewStations, rename *CustomStationSprite() to *CustomStationSpecIndex() to reflect their use, and alter the test for determining if a station has customised graphics.
peter1138
parents: 3545
diff changeset
   295
	return _m[t].m4 != 0;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   296
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   297
3568
c60d7aceed1a (svn r4450) - NewStations, rename *CustomStationSprite() to *CustomStationSpecIndex() to reflect their use, and alter the test for determining if a station has customised graphics.
peter1138
parents: 3545
diff changeset
   298
static inline void SetCustomStationSpecIndex(TileIndex t, byte specindex)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   299
{
3369
cab209754317 (svn r4166) Sprinkle several map accessors with assert()s
tron
parents: 3360
diff changeset
   300
	assert(IsTileType(t, MP_STATION));
3568
c60d7aceed1a (svn r4450) - NewStations, rename *CustomStationSprite() to *CustomStationSpecIndex() to reflect their use, and alter the test for determining if a station has customised graphics.
peter1138
parents: 3545
diff changeset
   301
	_m[t].m4 = specindex;
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   302
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   303
3568
c60d7aceed1a (svn r4450) - NewStations, rename *CustomStationSprite() to *CustomStationSpecIndex() to reflect their use, and alter the test for determining if a station has customised graphics.
peter1138
parents: 3545
diff changeset
   304
static inline uint GetCustomStationSpecIndex(TileIndex t)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   305
{
3369
cab209754317 (svn r4166) Sprinkle several map accessors with assert()s
tron
parents: 3360
diff changeset
   306
	assert(IsTileType(t, MP_STATION));
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   307
	return _m[t].m4;
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   308
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   309
3742
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   310
static inline void SetStationTileRandomBits(TileIndex t, byte random_bits)
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   311
{
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   312
	assert(IsTileType(t, MP_STATION));
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   313
	SB(_m[t].m3, 4, 4, random_bits);
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   314
}
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   315
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   316
static inline byte GetStationTileRandomBits(TileIndex t)
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   317
{
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   318
	assert(IsTileType(t, MP_STATION));
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   319
	return GB(_m[t].m3, 4, 4);
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   320
}
c5ef7a92daa5 (svn r4724) - Newstations: Add per-tile random data for station tiles.
peter1138
parents: 3568
diff changeset
   321
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   322
static inline void MakeStation(TileIndex t, Owner o, StationID sid, StationType st, byte section)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   323
{
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   324
	SetTileType(t, MP_STATION);
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   325
	SetTileOwner(t, o);
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   326
	_m[t].m2 = sid;
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   327
	_m[t].m3 = 0;
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   328
	_m[t].m4 = 0;
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   329
	_m[t].m5 = section;
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   330
	SB(_m[t].m6, 3, 3, st);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   331
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   332
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   333
static inline void MakeRailStation(TileIndex t, Owner o, StationID sid, Axis a, byte section, RailType rt)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   334
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   335
	MakeStation(t, o, sid, STATION_RAIL, section + a);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   336
	SetRailType(t, rt);
9784
a9cc0dff1667 (svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents: 9718
diff changeset
   337
	SetRailwayStationReservation(t, false);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   338
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   339
8785
871586967963 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents: 8471
diff changeset
   340
static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadTypes rt, DiagDirection d)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   341
{
8785
871586967963 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents: 8471
diff changeset
   342
	MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), d);
6661
1716fce5ad29 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6420
diff changeset
   343
	SetRoadTypes(t, rt);
6098
07544f189e9d (svn r8833) -Fix
tron
parents: 6012
diff changeset
   344
}
07544f189e9d (svn r8833) -Fix
tron
parents: 6012
diff changeset
   345
8785
871586967963 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents: 8471
diff changeset
   346
static inline void MakeDriveThroughRoadStop(TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadTypes rt, Axis a, bool on_town_road)
6098
07544f189e9d (svn r8833) -Fix
tron
parents: 6012
diff changeset
   347
{
8785
871586967963 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents: 8471
diff changeset
   348
	MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   349
	SB(_m[t].m6, 2, 1, on_town_road);
6661
1716fce5ad29 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6420
diff changeset
   350
	SetRoadTypes(t, rt);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   351
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   352
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   353
static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section)
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   354
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   355
	MakeStation(t, o, sid, STATION_AIRPORT, section);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   356
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   357
8471
ba4c15fe147b (svn r12042) -Fix [FS#1676]: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be
peter1138
parents: 8422
diff changeset
   358
static inline void MakeBuoy(TileIndex t, StationID sid, WaterClass wc)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   359
{
5953
b40dc8f4dc69 (svn r8619) -Fix: store the ownership of a water tile in the buoy tile and set the ownership of the water tile when the buoy is removed. This solves the issue of removing ownership from canal tiles thus making is possible for other players to remove the canal tile.
rubidium
parents: 5905
diff changeset
   360
	/* Make the owner of the buoy tile the same as the current owner of the
b40dc8f4dc69 (svn r8619) -Fix: store the ownership of a water tile in the buoy tile and set the ownership of the water tile when the buoy is removed. This solves the issue of removing ownership from canal tiles thus making is possible for other players to remove the canal tile.
rubidium
parents: 5905
diff changeset
   361
	 * water tile. In this way, we can reset the owner of the water to its
b40dc8f4dc69 (svn r8619) -Fix: store the ownership of a water tile in the buoy tile and set the ownership of the water tile when the buoy is removed. This solves the issue of removing ownership from canal tiles thus making is possible for other players to remove the canal tile.
rubidium
parents: 5905
diff changeset
   362
	 * original state when the buoy gets removed. */
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   363
	MakeStation(t, GetTileOwner(t), sid, STATION_BUOY, 0);
8471
ba4c15fe147b (svn r12042) -Fix [FS#1676]: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be
peter1138
parents: 8422
diff changeset
   364
	SetWaterClass(t, wc);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   365
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   366
8471
ba4c15fe147b (svn r12042) -Fix [FS#1676]: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be
peter1138
parents: 8422
diff changeset
   367
static inline void MakeDock(TileIndex t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   368
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   369
	MakeStation(t, o, sid, STATION_DOCK, d);
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   370
	MakeStation(t + TileOffsByDiagDir(d), o, sid, STATION_DOCK, GFX_DOCK_BASE_WATER_PART + DiagDirToAxis(d));
8471
ba4c15fe147b (svn r12042) -Fix [FS#1676]: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be
peter1138
parents: 8422
diff changeset
   371
	SetWaterClass(t + TileOffsByDiagDir(d), wc);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   372
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   373
9718
4b7468076d31 (svn r13838) -Codechange: Make industry tiles aware of WaterClasses.
frosch
parents: 9342
diff changeset
   374
static inline void MakeOilrig(TileIndex t, StationID sid, WaterClass wc)
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   375
{
7272
d47fc9e22d1c (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
rubidium
parents: 6661
diff changeset
   376
	MakeStation(t, OWNER_NONE, sid, STATION_OILRIG, 0);
9718
4b7468076d31 (svn r13838) -Codechange: Make industry tiles aware of WaterClasses.
frosch
parents: 9342
diff changeset
   377
	SetWaterClass(t, wc);
3334
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   378
}
2999d2ddc0f9 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents: 3315
diff changeset
   379
4666
172a0cdf28a6 (svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents: 4559
diff changeset
   380
#endif /* STATION_MAP_H */