ai_bridge.hpp

Go to the documentation of this file.
00001 /* $Id: ai_bridge.hpp 15520 2009-02-19 09:01:34Z yexo $ */
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 char *GetName(BridgeID bridge_id);
00061 
00071   static int32 GetMaxSpeed(BridgeID bridge_id);
00072 
00080   static Money GetPrice(BridgeID bridge_id, uint length);
00081 
00088   static int32 GetMaxLength(BridgeID bridge_id);
00089 
00096   static int32 GetMinLength(BridgeID bridge_id);
00097 
00098 #ifndef DOXYGEN_SKIP
00099 
00102   static bool _BuildBridgeRoad1();
00103 
00107   static bool _BuildBridgeRoad2();
00108 #endif
00109 
00137   static bool BuildBridge(AIVehicle::VehicleType vehicle_type, BridgeID bridge_id, TileIndex start, TileIndex end);
00138 
00146   static bool RemoveBridge(TileIndex tile);
00147 
00155   static TileIndex GetOtherBridgeEnd(TileIndex tile);
00156 };
00157 
00158 #endif /* AI_BRIDGE_HPP */

Generated on Mon Mar 9 23:33:45 2009 for openttd by  doxygen 1.5.6