script_tunnel.hpp

Go to the documentation of this file.
00001 /* $Id: script_tunnel.hpp 23633 2011-12-19 21:05:36Z truebrain $ */
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 SCRIPT_TUNNEL_HPP
00013 #define SCRIPT_TUNNEL_HPP
00014 
00015 #include "script_vehicle.hpp"
00016 
00021 class ScriptTunnel : public ScriptObject {
00022 public:
00026   enum ErrorMessages {
00027 
00029     ERR_TUNNEL_BASE = ScriptError::ERR_CAT_TUNNEL << ScriptError::ERR_CAT_BIT_SIZE,
00030 
00032     ERR_TUNNEL_CANNOT_BUILD_ON_WATER,            // [STR_ERROR_CAN_T_BUILD_ON_WATER]
00033 
00035     ERR_TUNNEL_START_SITE_UNSUITABLE,            // [STR_ERROR_SITE_UNSUITABLE_FOR_TUNNEL]
00036 
00038     ERR_TUNNEL_ANOTHER_TUNNEL_IN_THE_WAY,        // [STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY]
00039 
00041     ERR_TUNNEL_END_SITE_UNSUITABLE,              // [STR_ERROR_UNABLE_TO_EXCAVATE_LAND]
00042   };
00043 
00050   static bool IsTunnelTile(TileIndex tile);
00051 
00064   static TileIndex GetOtherTunnelEnd(TileIndex tile);
00065 
00070   static bool _BuildTunnelRoad1();
00071 
00076   static bool _BuildTunnelRoad2();
00077 
00102   static bool BuildTunnel(ScriptVehicle::VehicleType vehicle_type, TileIndex start);
00103 
00112   static bool RemoveTunnel(TileIndex tile);
00113 };
00114 
00115 #endif /* SCRIPT_TUNNEL_HPP */