truelight@9691: /* $Id$ */ truelight@9691: truebrain@9829: /** @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: 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. truebrain@9836: * @param tile The tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile to check. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile where the water depot will be build. truebrain@9836: * @param vertical If true, depot will be vertical, else horizontal. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile still on land of the dock. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile where the buoy will be build. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile where the lock will be build. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile The tile where the canal will be build. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile Any tile of the water depot. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile Any tile of the dock. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile Any tile of the buoy. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile Any tile of the lock. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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. truebrain@9836: * @param tile Any tile of the canal. truebrain@9801: * @pre AIMap::IsValidTile(tile). truebrain@9836: * @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 */