truelight@9691: /* $Id$ */ truelight@9691: truelight@9691: /** @file ai_marine.hpp Everything to query and build marine */ truelight@9691: truelight@9691: #ifndef AI_MARINE_HPP truelight@9691: #define AI_MARINE_HPP truelight@9691: truelight@9691: #include "ai_object.hpp" truelight@9691: truelight@9691: /** truelight@9691: * Class that handles all marine related functions. truelight@9691: */ truelight@9691: class AIMarine : public AIObject { truelight@9691: public: truelight@9691: /** truelight@9691: * The name of the class, needed by several sub-processes. truelight@9691: */ truelight@9691: static const char *GetClassName() { return "AIMarine"; } truelight@9691: truelight@9691: /** truelight@9691: * Checks whether the given tile is actually a tile with a water depot. truelight@9691: * @param tile the tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return true if and only if the tile has a water depot. truelight@9691: */ truelight@9691: static bool IsWaterDepotTile(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Checks whether the given tile is actually a tile with a dock. truelight@9691: * @param tile the tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return true if and only if the tile has a dock. truelight@9691: */ truelight@9691: static bool IsDockTile(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Checks whether the given tile is actually a tile with a buoy. truelight@9691: * @param tile the tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return true if and only if the tile has a buoy. truelight@9691: */ truelight@9691: static bool IsBuoyTile(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Checks whether the given tile is actually a tile with a lock. truelight@9691: * @param tile the tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return true if and only if the tile has a lock. truelight@9691: */ truelight@9691: static bool IsLockTile(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Checks whether the given tile is actually a tile with a canal. truelight@9691: * @param tile the tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return true if and only if the tile has a canal. truelight@9691: */ truelight@9691: static bool IsCanalTile(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Builds a water depot on tile. truelight@9691: * @param tile the tile where the water depot will be build. truelight@9691: * @param vertical if true, depot will be vertical, else horizontal. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the water depot has been/can be build or not. truelight@9691: */ truebrain@9737: static bool BuildWaterDepot(TileIndex tile, bool vertical); truelight@9691: truelight@9691: /** truelight@9691: * Builds a dock where tile is the tile still on land. truelight@9691: * @param tile the tile still on land of the dock. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the dock has been/can be build or not. truelight@9691: */ truebrain@9737: static bool BuildDock(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Builds a buoy on tile. truelight@9691: * @param tile the tile where the buoy will be build. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the buoy has been/can be build or not. truelight@9691: */ truebrain@9737: static bool BuildBuoy(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Builds a lock on tile. truelight@9691: * @param tile the tile where the lock will be build. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the lock has been/can be build or not. truelight@9691: */ truebrain@9737: static bool BuildLock(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Builds a canal on tile. truelight@9691: * @param tile the tile where the canal will be build. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the canal has been/can be build or not. truelight@9691: */ truebrain@9737: static bool BuildCanal(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Removes a water depot. truelight@9691: * @param tile any tile of the water depot. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the water depot has been/can be removed or not. truelight@9691: */ truebrain@9737: static bool RemoveWaterDepot(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Removes a dock. truelight@9691: * @param tile any tile of the dock. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the dock has been/can be removed or not. truelight@9691: */ truebrain@9737: static bool RemoveDock(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Removes a buoy. truelight@9691: * @param tile any tile of the buoy. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the buoy has been/can be removed or not. truelight@9691: */ truebrain@9737: static bool RemoveBuoy(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Removes a lock. truelight@9691: * @param tile any tile of the lock. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the lock has been/can be removed or not. truelight@9691: */ truebrain@9737: static bool RemoveLock(TileIndex tile); truelight@9691: truelight@9691: /** truelight@9691: * Removes a canal. truelight@9691: * @param tile any tile of the canal. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9691: * @return whether the canal has been/can be removed or not. truelight@9691: */ truebrain@9737: static bool RemoveCanal(TileIndex tile); truelight@9691: }; truelight@9691: truelight@9691: #endif /* AI_MARINE_HPP */