src/ai/api/ai_marine.hpp
branchnoai
changeset 9691 1231d4e5f5aa
child 9737 ee408edf3851
equal deleted inserted replaced
9690:ac2ee072cebf 9691:1231d4e5f5aa
       
     1 /* $Id$ */
       
     2 
       
     3 /** @file ai_marine.hpp Everything to query and build marine */
       
     4 
       
     5 #ifndef AI_MARINE_HPP
       
     6 #define AI_MARINE_HPP
       
     7 
       
     8 #include "ai_object.hpp"
       
     9 
       
    10 /**
       
    11  * Class that handles all marine related functions.
       
    12  */
       
    13 class AIMarine : public AIObject {
       
    14 public:
       
    15 	/**
       
    16 	 * The name of the class, needed by several sub-processes.
       
    17 	 */
       
    18 	static const char *GetClassName() { return "AIMarine"; }
       
    19 
       
    20 	/**
       
    21 	 * Checks whether the given tile is actually a tile with a water depot.
       
    22 	 * @param tile the tile to check.
       
    23 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    24 	 * @return true if and only if the tile has a water depot.
       
    25 	 */
       
    26 	static bool IsWaterDepotTile(TileIndex tile);
       
    27 
       
    28 	/**
       
    29 	 * Checks whether the given tile is actually a tile with a dock.
       
    30 	 * @param tile the tile to check.
       
    31 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    32 	 * @return true if and only if the tile has a dock.
       
    33 	 */
       
    34 	static bool IsDockTile(TileIndex tile);
       
    35 
       
    36 	/**
       
    37 	 * Checks whether the given tile is actually a tile with a buoy.
       
    38 	 * @param tile the tile to check.
       
    39 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    40 	 * @return true if and only if the tile has a buoy.
       
    41 	 */
       
    42 	static bool IsBuoyTile(TileIndex tile);
       
    43 
       
    44 	/**
       
    45 	 * Checks whether the given tile is actually a tile with a lock.
       
    46 	 * @param tile the tile to check.
       
    47 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    48 	 * @return true if and only if the tile has a lock.
       
    49 	 */
       
    50 	static bool IsLockTile(TileIndex tile);
       
    51 
       
    52 	/**
       
    53 	 * Checks whether the given tile is actually a tile with a canal.
       
    54 	 * @param tile the tile to check.
       
    55 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    56 	 * @return true if and only if the tile has a canal.
       
    57 	 */
       
    58 	static bool IsCanalTile(TileIndex tile);
       
    59 
       
    60 	/**
       
    61 	 * Builds a water depot on tile.
       
    62 	 * @param tile the tile where the water depot will be build.
       
    63 	 * @param vertical if true, depot will be vertical, else horizontal.
       
    64 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    65 	 * @return whether the water depot has been/can be build or not.
       
    66 	 */
       
    67 	bool BuildWaterDepot(TileIndex tile, bool vertical);
       
    68 
       
    69 	/**
       
    70 	 * Builds a dock where tile is the tile still on land.
       
    71 	 * @param tile the tile still on land of the dock.
       
    72 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    73 	 * @return whether the dock has been/can be build or not.
       
    74 	 */
       
    75 	bool BuildDock(TileIndex tile);
       
    76 
       
    77 	/**
       
    78 	 * Builds a buoy on tile.
       
    79 	 * @param tile the tile where the buoy will be build.
       
    80 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    81 	 * @return whether the buoy has been/can be build or not.
       
    82 	 */
       
    83 	bool BuildBuoy(TileIndex tile);
       
    84 
       
    85 	/**
       
    86 	 * Builds a lock on tile.
       
    87 	 * @param tile the tile where the lock will be build.
       
    88 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    89 	 * @return whether the lock has been/can be build or not.
       
    90 	 */
       
    91 	bool BuildLock(TileIndex tile);
       
    92 
       
    93 	/**
       
    94 	 * Builds a canal on tile.
       
    95 	 * @param tile the tile where the canal will be build.
       
    96 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
    97 	 * @return whether the canal has been/can be build or not.
       
    98 	 */
       
    99 	bool BuildCanal(TileIndex tile);
       
   100 
       
   101 	/**
       
   102 	 * Removes a water depot.
       
   103 	 * @param tile any tile of the water depot.
       
   104 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
   105 	 * @return whether the water depot has been/can be removed or not.
       
   106 	 */
       
   107 	bool RemoveWaterDepot(TileIndex tile);
       
   108 
       
   109 	/**
       
   110 	 * Removes a dock.
       
   111 	 * @param tile any tile of the dock.
       
   112 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
   113 	 * @return whether the dock has been/can be removed or not.
       
   114 	 */
       
   115 	bool RemoveDock(TileIndex tile);
       
   116 
       
   117 	/**
       
   118 	 * Removes a buoy.
       
   119 	 * @param tile any tile of the buoy.
       
   120 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
   121 	 * @return whether the buoy has been/can be removed or not.
       
   122 	 */
       
   123 	bool RemoveBuoy(TileIndex tile);
       
   124 
       
   125 	/**
       
   126 	 * Removes a lock.
       
   127 	 * @param tile any tile of the lock.
       
   128 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
   129 	 * @return whether the lock has been/can be removed or not.
       
   130 	 */
       
   131 	bool RemoveLock(TileIndex tile);
       
   132 
       
   133 	/**
       
   134 	 * Removes a canal.
       
   135 	 * @param tile any tile of the canal.
       
   136 	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
       
   137 	 * @return whether the canal has been/can be removed or not.
       
   138 	 */
       
   139 	bool RemoveCanal(TileIndex tile);
       
   140 };
       
   141 
       
   142 #endif /* AI_MARINE_HPP */