equal
deleted
inserted
replaced
56 |
56 |
57 /** |
57 /** |
58 * Builds a tunnel starting at start. The direction of the tunnel depends |
58 * Builds a tunnel starting at start. The direction of the tunnel depends |
59 * on the slope of the start tile. Tunnels can be created for either |
59 * on the slope of the start tile. Tunnels can be created for either |
60 * rails or roads; use the appropriate AIVehicle::VehicleType. |
60 * rails or roads; use the appropriate AIVehicle::VehicleType. |
|
61 * As an extra for road, this functions builds two half-pieces of road on |
|
62 * each end of the tunnel, making it easier for you to connect it to your |
|
63 * network. |
61 * @param start Where to start the tunnel. |
64 * @param start Where to start the tunnel. |
62 * @param vehicle_type The vehicle-type of tunnel to build. |
65 * @param vehicle_type The vehicle-type of tunnel to build. |
63 * @pre AIMap::IsValidTile(start). |
66 * @pre AIMap::IsValidTile(start). |
64 * @pre 'vehicle_type' is either AIVehicle::VEHICLE_RAIL or AIVEHICLE::VEHICLE_ROAD. |
67 * @pre 'vehicle_type' is either AIVehicle::VEHICLE_RAIL or AIVEHICLE::VEHICLE_ROAD. |
65 * @exception AIError::ERR_AREA_NOT_CLEAR |
68 * @exception AIError::ERR_AREA_NOT_CLEAR |
67 * @exception AITunnel::ERR_TUNNEL_START_SITE_UNSUITABLE |
70 * @exception AITunnel::ERR_TUNNEL_START_SITE_UNSUITABLE |
68 * @exception AITunnel::ERR_TUNNEL_ANOTHER_TUNNEL_IN_THE_WAY |
71 * @exception AITunnel::ERR_TUNNEL_ANOTHER_TUNNEL_IN_THE_WAY |
69 * @exception AITunnel::ERR_TUNNEL_END_SITE_UNSUITABLE |
72 * @exception AITunnel::ERR_TUNNEL_END_SITE_UNSUITABLE |
70 * @return Whether the tunnel has been/can be build or not. |
73 * @return Whether the tunnel has been/can be build or not. |
71 * @note The slope of a tile can be determined by AITile::GetSlope(TileIndex). |
74 * @note The slope of a tile can be determined by AITile::GetSlope(TileIndex). |
|
75 * @note No matter if the road pieces were build or not, if building the |
|
76 * tunnel succeeded, this function returns true. |
72 */ |
77 */ |
73 static bool BuildTunnel(AIVehicle::VehicleType vehicle_type, TileIndex start); |
78 static bool BuildTunnel(AIVehicle::VehicleType vehicle_type, TileIndex start); |
74 |
79 |
75 /** |
80 /** |
76 * Remove the tunnel whose entrance is located at tile. |
81 * Remove the tunnel whose entrance is located at tile. |