# ai_bridge.hpp

Go to the documentation of this file.

    00001 /* $Id: ai_bridge.hpp 15904 2009-03-30 23:22:13Z rubidium $ */
    00002
    00005 #ifndef AI_BRIDGE_HPP
    00006 #define AI_BRIDGE_HPP
    00007
    00008 #include "ai_object.hpp"
    00009 #include "ai_vehicle.hpp"
    00010 #include "ai_error.hpp"
    00011
    00015 class AIBridge : public AIObject {
    00016 public:
    00020   enum ErrorMessages {
    00022     ERR_BRIDGE_BASE = AIError::ERR_CAT_BRIDGE << AIError::ERR_CAT_BIT_SIZE,
    00023
    00028     ERR_BRIDGE_TYPE_UNAVAILABLE,         // [STR_5015_CAN_T_BUILD_BRIDGE_HERE]
    00029
    00031     ERR_BRIDGE_CANNOT_END_IN_WATER,      // [STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH]
    00032
    00034     ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT, // [STR_BRIDGEHEADS_NOT_SAME_HEIGHT]
    00035   };
    00036
    00037   static const char *GetClassName() { return "AIBridge"; }
    00038
    00044   static bool IsValidBridge(BridgeID bridge_id);
    00045
    00052   static bool IsBridgeTile(TileIndex tile);
    00053
    00060   static BridgeID GetBridgeID(TileIndex tile);
    00061
    00068   static char *GetName(BridgeID bridge_id);
    00069
    00079   static int32 GetMaxSpeed(BridgeID bridge_id);
    00080
    00088   static Money GetPrice(BridgeID bridge_id, uint length);
    00089
    00096   static int32 GetMaxLength(BridgeID bridge_id);
    00097
    00104   static int32 GetMinLength(BridgeID bridge_id);
    00105
    00106 #ifndef DOXYGEN_SKIP
    00107
    00110   static bool _BuildBridgeRoad1();
    00111
    00115   static bool _BuildBridgeRoad2();
    00116 #endif
    00117
    00145   static bool BuildBridge(AIVehicle::VehicleType vehicle_type, BridgeID bridge_id, TileIndex start, TileIndex end);
    00146
    00154   static bool RemoveBridge(TileIndex tile);
    00155
    00163   static TileIndex GetOtherBridgeEnd(TileIndex tile);
    00164 };
    00165
    00166 #endif /* AI_BRIDGE_HPP */