src/ai/api/ai_bridge.hpp
branchnoai
changeset 9835 2541c2d325ed
parent 9829 80fbe02a4184
child 9838 0839682a601b
equal deleted inserted replaced
9834:9abe20fc83e5 9835:2541c2d325ed
    26 	 */
    26 	 */
    27 	static bool IsValidBridge(BridgeID bridge_id);
    27 	static bool IsValidBridge(BridgeID bridge_id);
    28 
    28 
    29 	/**
    29 	/**
    30 	 * Checks whether the given tile is actually a bridge start or end tile.
    30 	 * Checks whether the given tile is actually a bridge start or end tile.
    31 	 * @param tile the tile to check.
    31 	 * @param tile The tile to check.
    32 	 * @pre AIMap::IsValidTile(tile).
    32 	 * @pre AIMap::IsValidTile(tile).
    33 	 * @return true if and only if the tile is the beginning or end of a bridge.
    33 	 * @return True if and only if the tile is the beginning or end of a bridge.
    34 	 */
    34 	 */
    35 	static bool IsBridgeTile(TileIndex tile);
    35 	static bool IsBridgeTile(TileIndex tile);
    36 
    36 
    37 	/**
    37 	/**
    38 	 * Get the name of a bridge.
    38 	 * Get the name of a bridge.
    39 	 * @param bridge_id The bridge to get the name of.
    39 	 * @param bridge_id The bridge to get the name of.
    40 	 * @pre IsValidBridge(bridge_id).
    40 	 * @pre IsValidBridge(bridge_id).
    41 	 * @return The name the bridge has.
    41 	 * @return The name the bridge has.
    42 	 * @note the returned name must be free'd (C++ only).
       
    43 	 */
    42 	 */
    44 	static char *GetName(BridgeID bridge_id);
    43 	static char *GetName(BridgeID bridge_id);
    45 
    44 
    46 	/**
    45 	/**
    47 	 * Get the maximum speed of a bridge (in km/h).
    46 	 * Get the maximum speed of a bridge (in km/h).
    76 	 */
    75 	 */
    77 	static uint32 GetMinLength(BridgeID bridge_id);
    76 	static uint32 GetMinLength(BridgeID bridge_id);
    78 
    77 
    79 	/**
    78 	/**
    80 	 * Get the year in which a bridge becomes available.
    79 	 * Get the year in which a bridge becomes available.
    81 	 * @note Years are like 2010, -10 (10 B.C.), 1950, ..
       
    82 	 * @param bridge_id The bridge to get the year of availability of.
    80 	 * @param bridge_id The bridge to get the year of availability of.
    83 	 * @pre IsValidBridge(bridge_id).
    81 	 * @pre IsValidBridge(bridge_id).
    84 	 * @returns The year of availability the bridge has.
    82 	 * @returns The year of availability the bridge has.
       
    83 	 * @note Years are like 2010, -10 (10 B.C.), 1950, ..
    85 	 */
    84 	 */
    86 	static int32 GetYearAvailable(BridgeID bridge_id);
    85 	static int32 GetYearAvailable(BridgeID bridge_id);
    87 
    86 
    88 	/**
    87 	/**
    89 	 * Build a bridge from one tile to the other.
    88 	 * Build a bridge from one tile to the other.
    91 	 * @param bridge_id The bridge-type to build.
    90 	 * @param bridge_id The bridge-type to build.
    92 	 * @param start Where to start the bridge.
    91 	 * @param start Where to start the bridge.
    93 	 * @param end Where to end the bridge.
    92 	 * @param end Where to end the bridge.
    94 	 * @pre AIMap::IsValidTile(start).
    93 	 * @pre AIMap::IsValidTile(start).
    95 	 * @pre AIMap::IsValidTile(end).
    94 	 * @pre AIMap::IsValidTile(end).
    96 	 * @pre start and end are in a straight line, i.e.
    95 	 * @pre 'start' and 'end' are in a straight line, i.e.
    97 	 *  AIMap::GetTileX(start) == AIMap::GetTileX(end) or
    96 	 *  AIMap::GetTileX(start) == AIMap::GetTileX(end) or
    98 	 *  AIMap::GetTileY(start) == AIMap::GetTileY(end).
    97 	 *  AIMap::GetTileY(start) == AIMap::GetTileY(end).
    99 	 * @pre vehicleType is either AIVehicle::VEHICLE_RAIL or AIVEHICLE::VEHICLE_ROAD.
    98 	 * @pre VehicleType is either AIVehicle::VEHICLE_RAIL or AIVEHICLE::VEHICLE_ROAD.
   100 	 * @return Whether the bridge has been/can be build or not.
    99 	 * @return Whether the bridge has been/can be build or not.
   101 	 */
   100 	 */
   102 	static bool BuildBridge(AIVehicle::VehicleType vehicle_type, BridgeID bridge_id, TileIndex start, TileIndex end);
   101 	static bool BuildBridge(AIVehicle::VehicleType vehicle_type, BridgeID bridge_id, TileIndex start, TileIndex end);
   103 
   102 
   104 	/**
   103 	/**