src/ai/api/ai_bridge.hpp
author truebrain
Mon, 07 Apr 2008 12:30:28 +0000
branchnoai
changeset 9870 875cae2f4696
parent 9867 b7d9ffe24f81
child 9873 b1ab23560ecb
permissions -rw-r--r--
(svn r12602) [NoAI] -Fix: minor type in documentation
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
     1
/* $Id$ */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
     2
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
     3
/** @file ai_bridge.hpp Everything to query and build bridges. */
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
     4
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
     5
#ifndef AI_BRIDGE_HPP
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
     6
#define AI_BRIDGE_HPP
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
     7
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
     8
#include "ai_object.hpp"
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
     9
#include "ai_vehicle.hpp"
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    10
#include "ai_error.hpp"
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    11
#include "../../bridge.h"
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    12
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
    13
/** In OpenTTD Core 'BridgeID' is called 'BridgeType', so map it to make this API more logic. */
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    14
typedef BridgeType BridgeID;
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    15
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    16
/**
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    17
 * Class that handles all bridge related functions.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    18
 */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    19
class AIBridge : public AIObject {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    20
public:
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    21
	enum ErrorMessages {
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    22
		/** Base for bridge related errors */
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    23
		ERR_BRIDGE_BASE = AIError::ERR_CAT_BRIDGE << AIError::ERR_CAT_BIT_SIZE,
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    24
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    25
		/**
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    26
		 * The bridge you want to build is not available yet,
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    27
		 * or it is not available for the requested length.
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    28
		 */
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    29
		ERR_BRIDGE_TYPE_UNAVAILABLE,         // [STR_5015_CAN_T_BUILD_BRIDGE_HERE]
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    30
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    31
		/** One (or more) of the bridge head(s) ends in water. */
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    32
		ERR_BRIDGE_CANNOT_END_IN_WATER,      // [STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH]
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    33
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    34
		/** Slope of the land does not allow the required bridge head. */
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    35
		ERR_BRIDGE_SLOPE_WRONG,              // [STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION]
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    36
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    37
		/** The bride heads need to be on the same height */
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    38
		ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT, // [STR_BRIDGEHEADS_NOT_SAME_HEIGHT]
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    39
	};
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
    40
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    41
	static const char *GetClassName() { return "AIBridge"; }
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    42
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    43
	/**
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    44
	 * Checks whether the given bridge type is valid.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    45
	 * @param bridge_id The bridge to check.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    46
	 * @return True if and only if the bridge type is valid.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    47
	 */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    48
	static bool IsValidBridge(BridgeID bridge_id);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    49
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    50
	/**
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
    51
	 * Checks whether the given tile is actually a bridge start or end tile.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    52
	 * @param tile The tile to check.
9801
03a3eebd7fb7 (svn r12307) [NoAI] -Codechange: as followup on r12303 (trunk), use ::IsValidTile to check if a tile is inside the map, instead of all our custom ways
truebrain
parents: 9793
diff changeset
    53
	 * @pre AIMap::IsValidTile(tile).
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    54
	 * @return True if and only if the tile is the beginning or end of a bridge.
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
    55
	 */
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
    56
	static bool IsBridgeTile(TileIndex tile);
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
    57
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
    58
	/**
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    59
	 * Get the name of a bridge.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    60
	 * @param bridge_id The bridge to get the name of.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    61
	 * @pre IsValidBridge(bridge_id).
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    62
	 * @return The name the bridge has.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    63
	 */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    64
	static char *GetName(BridgeID bridge_id);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    65
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    66
	/**
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    67
	 * Get the maximum speed of a bridge (in km/h).
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    68
	 * @param bridge_id The bridge to get the maximum speed of.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    69
	 * @pre IsValidBridge(bridge_id).
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    70
	 * @return The maximum speed the bridge has.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    71
	 */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    72
	static uint32 GetMaxSpeed(BridgeID bridge_id);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    73
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    74
	/**
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    75
	 * Get the new cost of a bridge.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    76
	 * @param bridge_id The bridge to get the new cost of.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    77
	 * @param length The length of the bridge.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    78
	 * @pre IsValidBridge(bridge_id).
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    79
	 * @return The new cost the bridge has.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    80
	 */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    81
	static uint32 GetPrice(BridgeID bridge_id, uint length);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    82
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    83
	/**
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    84
	 * Get the maximum length of a bridge.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    85
	 * @param bridge_id The bridge to get the maximum length of.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    86
	 * @pre IsValidBridge(bridge_id).
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    87
	 * @returns The maximum length the bridge has.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    88
	 */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    89
	static uint32 GetMaxLength(BridgeID bridge_id);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    90
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    91
	/**
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    92
	 * Get the minimum length of a bridge.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    93
	 * @param bridge_id The bridge to get the minimum length of.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    94
	 * @pre IsValidBridge(bridge_id).
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    95
	 * @returns The minimum length the bridge has.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    96
	 */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    97
	static uint32 GetMinLength(BridgeID bridge_id);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    98
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
    99
	/**
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   100
	 * Get the year in which a bridge becomes available.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   101
	 * @param bridge_id The bridge to get the year of availability of.
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   102
	 * @pre IsValidBridge(bridge_id).
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   103
	 * @returns The year of availability the bridge has.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   104
	 * @note Years are like 2010, -10 (10 B.C.), 1950, ..
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   105
	 */
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   106
	static int32 GetYearAvailable(BridgeID bridge_id);
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   107
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   108
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   109
	 * Build a bridge from one tile to the other.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   110
	 * @param vehicle_type The vehicle-type of bridge to build.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   111
	 * @param bridge_id The bridge-type to build.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   112
	 * @param start Where to start the bridge.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   113
	 * @param end Where to end the bridge.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   114
	 * @pre AIMap::IsValidTile(start).
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   115
	 * @pre AIMap::IsValidTile(end).
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   116
	 * @pre 'start' and 'end' are in a straight line, i.e.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   117
	 *  AIMap::GetTileX(start) == AIMap::GetTileX(end) or
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   118
	 *  AIMap::GetTileY(start) == AIMap::GetTileY(end).
9870
875cae2f4696 (svn r12602) [NoAI] -Fix: minor type in documentation
truebrain
parents: 9867
diff changeset
   119
	 * @pre 'vehicle_type' is either AIVehicle::VEHICLE_RAIL or AIVehicle::VEHICLE_ROAD.
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
   120
	 * @exception AIError::ERR_ALREADY_BUILT
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
   121
	 * @exception AIError::ERR_AREA_NOT_CLEAR
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
   122
	 * @exception AIBridge::ERR_BRIDGE_TYPE_UNAVAILABLE
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
   123
	 * @exception AIBridge::ERR_BRIDGE_CANNOT_END_IN_WATER
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
   124
	 * @exception AIBridge::ERR_BRIDGE_SLOPE_WRONG
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9838
diff changeset
   125
	 * @exception AIBridge::ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   126
	 * @return Whether the bridge has been/can be build or not.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   127
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   128
	static bool BuildBridge(AIVehicle::VehicleType vehicle_type, BridgeID bridge_id, TileIndex start, TileIndex end);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   129
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   130
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   131
	 * Removes a bridge, by executing it on either the start or end tile.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   132
	 * @param tile An end or start tile of the bridge.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   133
	 * @pre AIMap::IsValidTile(tile).
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   134
	 * @return Whether the bridge has been/can be removed or not.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   135
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9801
diff changeset
   136
	static bool RemoveBridge(TileIndex tile);
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   137
};
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   138
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
diff changeset
   139
#endif /* AI_BRIDGE_HPP */