# ai_tunnel.hpp

Go to the documentation of this file.

    00001 /* $Id: ai_tunnel.hpp 18683 2010-01-01 18:45:40Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #ifndef AI_TUNNEL_HPP
    00013 #define AI_TUNNEL_HPP
    00014
    00015 #include "ai_object.hpp"
    00016 #include "ai_vehicle.hpp"
    00017
    00021 class AITunnel : public AIObject {
    00022 public:
    00023   static const char *GetClassName() { return "AITunnel"; }
    00024
    00028   enum ErrorMessages {
    00029
    00031     ERR_TUNNEL_BASE = AIError::ERR_CAT_TUNNEL << AIError::ERR_CAT_BIT_SIZE,
    00032
    00034     ERR_TUNNEL_CANNOT_BUILD_ON_WATER,            // [STR_ERROR_CAN_T_BUILD_ON_WATER]
    00035
    00037     ERR_TUNNEL_START_SITE_UNSUITABLE,            // [STR_ERROR_SITE_UNSUITABLE_FOR_TUNNEL]
    00038
    00040     ERR_TUNNEL_ANOTHER_TUNNEL_IN_THE_WAY,        // [STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY]
    00041
    00043     ERR_TUNNEL_END_SITE_UNSUITABLE,              // [STR_ERROR_UNABLE_TO_EXCAVATE_LAND]
    00044   };
    00045
    00052   static bool IsTunnelTile(TileIndex tile);
    00053
    00066   static TileIndex GetOtherTunnelEnd(TileIndex tile);
    00067
    00068 #ifndef DOXYGEN_SKIP
    00069
    00072   static bool _BuildTunnelRoad1();
    00073
    00077   static bool _BuildTunnelRoad2();
    00078 #endif /* DOXYGEN_SKIP */
    00079
    00102   static bool BuildTunnel(AIVehicle::VehicleType vehicle_type, TileIndex start);
    00103
    00111   static bool RemoveTunnel(TileIndex tile);
    00112 };
    00113
    00114 #endif /* AI_TUNNEL_HPP */