Add map/rail.h with railway tile accessors
[openttd/fttd.git] / src / tunnelbridge_map.h
blobea6d13652c2f6bc57cedf5e0c5adcc027521aae4
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file tunnelbridge_map.h Functions that have tunnels and bridges in common */
12 #ifndef TUNNELBRIDGE_MAP_H
13 #define TUNNELBRIDGE_MAP_H
15 #include "bridge_map.h"
16 #include "map/tunnel.h"
19 /**
20 * Determines type of the wormhole and returns its other end
21 * @param t one end
22 * @pre IsTunnelTile(t) || IsBridgeHeadTile(t)
23 * @return other end
25 static inline TileIndex GetOtherTunnelBridgeEnd(TileIndex t)
27 assert(IsTunnelTile(t) || IsBridgeHeadTile(t));
28 return IsTunnelTile(t) ? GetOtherTunnelEnd(t) : GetOtherBridgeEnd(t);
32 #endif /* TUNNELBRIDGE_MAP_H */