15 * The name of the class, needed by several sub-processes. |
15 * The name of the class, needed by several sub-processes. |
16 */ |
16 */ |
17 static const char *GetClassName() { return "AITunnel"; } |
17 static const char *GetClassName() { return "AITunnel"; } |
18 |
18 |
19 /** |
19 /** |
20 * Check wether the tile is an entrance to a tunnel. |
20 * Check whether the tile is an entrance to a tunnel. |
21 * @pre AIMap::IsValidTile(tile). |
21 * @pre AIMap::IsValidTile(tile). |
22 * @param tile The tile to check. |
22 * @param tile The tile to check. |
23 * @note true if and only if the tile is the beginning or end of a tunnel. |
23 * @note true if and only if the tile is the beginning or end of a tunnel. |
24 */ |
24 */ |
25 static bool IsTunnelTile(TileIndex tile); |
25 static bool IsTunnelTile(TileIndex tile); |
26 |
26 |
27 /** |
27 /** |
28 * Get the tile that exits on the other end of a tunnel starting at tunnelTile. |
28 * Get the tile that exits on the other end of a (would be) tunnel starting at tile. |
29 * @pre AIMap::IsValidTile(tile) && IsTunnelTile(tile). |
29 * @pre AIMap::IsValidTile(tile). |
30 * @param tile A tile that is an entrance to a tunnel. |
30 * @param tile A tile that is an entrance to a tunnel or a tile where you may want to build a tunnel. |
31 * @return The TileIndex that is the other end of the tunnel. |
31 * @return The TileIndex that is the other end of the (would be) tunnel, or 'tile' if no other end was found (crossing tunnels). |
32 */ |
32 */ |
33 static TileIndex GetOtherTunnelEnd(TileIndex tile); |
33 static TileIndex GetOtherTunnelEnd(TileIndex tile); |
34 |
34 |
35 /** |
35 /** |
36 * Builds a tunnel starting at start. The direction of the tunnel depends |
36 * Builds a tunnel starting at start. The direction of the tunnel depends |