00001 /* $Id: script_marine.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_MARINE_HPP 00013 #define SCRIPT_MARINE_HPP 00014 00015 #include "script_error.hpp" 00016 00021 class ScriptMarine : public ScriptObject { 00022 public: 00026 enum ErrorMessages { 00028 ERR_MARINE_BASE = ScriptError::ERR_CAT_MARINE << ScriptError::ERR_CAT_BIT_SIZE, 00029 00031 ERR_MARINE_MUST_BE_BUILT_ON_WATER, // [STR_ERROR_MUST_BE_BUILT_ON_WATER] 00032 }; 00033 00037 enum BuildType { 00038 BT_DOCK, 00039 BT_DEPOT, 00040 BT_BUOY, 00041 }; 00042 00049 static bool IsWaterDepotTile(TileIndex tile); 00050 00057 static bool IsDockTile(TileIndex tile); 00058 00065 static bool IsBuoyTile(TileIndex tile); 00066 00073 static bool IsLockTile(TileIndex tile); 00074 00081 static bool IsCanalTile(TileIndex tile); 00082 00094 static bool AreWaterTilesConnected(TileIndex tile_from, TileIndex tile_to); 00095 00110 static bool BuildWaterDepot(TileIndex tile, TileIndex front); 00111 00125 static bool BuildDock(TileIndex tile, StationID station_id); 00126 00137 static bool BuildBuoy(TileIndex tile); 00138 00148 static bool BuildLock(TileIndex tile); 00149 00161 static bool BuildCanal(TileIndex tile); 00162 00171 static bool RemoveWaterDepot(TileIndex tile); 00172 00181 static bool RemoveDock(TileIndex tile); 00182 00191 static bool RemoveBuoy(TileIndex tile); 00192 00201 static bool RemoveLock(TileIndex tile); 00202 00211 static bool RemoveCanal(TileIndex tile); 00212 00218 static Money GetBuildCost(BuildType build_type); 00219 }; 00220 00221 #endif /* SCRIPT_MARINE_HPP */