src/ai/api/ai_tile.hpp
branchnoai
changeset 10094 e737405b06dd
parent 10089 e351169bf3a5
child 10191 da75d1460a4b
equal deleted inserted replaced
10093:b3849a19d137 10094:e737405b06dd
    22 
    22 
    23 		/** Base for tile related errors */
    23 		/** Base for tile related errors */
    24 		ERR_TILE_BASE = AIError::ERR_CAT_TILE << AIError::ERR_CAT_BIT_SIZE,
    24 		ERR_TILE_BASE = AIError::ERR_CAT_TILE << AIError::ERR_CAT_BIT_SIZE,
    25 
    25 
    26 		/** Tile can't be raised any higher */
    26 		/** Tile can't be raised any higher */
    27 		ERR_TILE_TOO_HIGH,                     //< [STR_1003_ALREADY_AT_SEA_LEVEL]
    27 		ERR_TILE_TOO_HIGH,                     // [STR_1003_ALREADY_AT_SEA_LEVEL]
    28 
    28 
    29 		/** Tile can't be lowered any lower */
    29 		/** Tile can't be lowered any lower */
    30 		ERR_TILE_TOO_LOW,                      //< [STR_1003_ALREADY_AT_SEA_LEVEL]
    30 		ERR_TILE_TOO_LOW,                      // [STR_1003_ALREADY_AT_SEA_LEVEL]
    31 
       
    32 		/** Tile can't be raised or lowered because it is to close to the map */
       
    33 		ERR_TILE_TOO_CLOSE_TO_EDGE,            //< [STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP]
       
    34 	};
    31 	};
    35 
    32 
    36 	/**
    33 	/**
    37 	 * Enumeration for the slope-type (from slopes.h).
    34 	 * Enumeration for the slope-type (from slopes.h).
    38 	 *
    35 	 *
   159 	 * Raise the given corners of the tile. The corners can be combined,
   156 	 * Raise the given corners of the tile. The corners can be combined,
   160 	 *  for example: SLOPE_N | SLOPE_W (= SLOPE_NW)
   157 	 *  for example: SLOPE_N | SLOPE_W (= SLOPE_NW)
   161 	 * @param tile The tile to raise.
   158 	 * @param tile The tile to raise.
   162 	 * @param slope Corners to raise (SLOPE_xxx).
   159 	 * @param slope Corners to raise (SLOPE_xxx).
   163 	 * @pre AIMap::IsValidTile(tile).
   160 	 * @pre AIMap::IsValidTile(tile).
   164 	 * @exception AIERROR::ERR_AREA_NOT_CLEAR
   161 	 * @exception AIError::ERR_AREA_NOT_CLEAR
   165 	 * @exception AITILE::ERR_TILE_TOO_HIGH
   162 	 * @exception AIError::ERR_TOO_CLOSE_TO_EDGE
   166 	 * @exception AITILE::ERR_TILE_CLOSE_TO_EDGE
   163 	 * @exception AITile::ERR_TILE_TOO_HIGH
   167 	 * @return 0 means failed, 1 means success.
   164 	 * @return 0 means failed, 1 means success.
   168 	 */
   165 	 */
   169 	static bool RaiseTile(TileIndex tile, int32 slope);
   166 	static bool RaiseTile(TileIndex tile, int32 slope);
   170 
   167 
   171 	/**
   168 	/**
   172 	 * Lower the given corners of the tile. The corners can be combined,
   169 	 * Lower the given corners of the tile. The corners can be combined,
   173 	 *  for example: SLOPE_N | SLOPE_W (= SLOPE_NW)
   170 	 *  for example: SLOPE_N | SLOPE_W (= SLOPE_NW)
   174 	 * @param tile The tile to lower.
   171 	 * @param tile The tile to lower.
   175 	 * @param slope Corners to lower (SLOPE_xxx).
   172 	 * @param slope Corners to lower (SLOPE_xxx).
   176 	 * @pre AIMap::IsValidTile(tile).
   173 	 * @pre AIMap::IsValidTile(tile).
   177 	 * @exception AIERROR::ERR_AREA_NOT_CLEAR
   174 	 * @exception AIError::ERR_AREA_NOT_CLEAR
   178 	 * @exception AITILE::ERR_TILE_TOO_LOW
   175 	 * @exception AIError::ERR_TOO_CLOSE_TO_EDGE
   179 	 * @exception AITILE::ERR_TILE_CLOSE_TO_EDGE
   176 	 * @exception AITile::ERR_TILE_TOO_LOW
   180 	 * @return 0 means failed, 1 means success.
   177 	 * @return 0 means failed, 1 means success.
   181 	 */
   178 	 */
   182 	static bool LowerTile(TileIndex tile, int32 slope);
   179 	static bool LowerTile(TileIndex tile, int32 slope);
   183 
   180 
   184 	/**
   181 	/**
   185 	 * Destroy everything on the given tile.
   182 	 * Destroy everything on the given tile.
   186 	 * @param tile The tile to demolish.
   183 	 * @param tile The tile to demolish.
   187 	 * @pre AIMap::IsValidTile(tile).
   184 	 * @pre AIMap::IsValidTile(tile).
   188 	 * @exception AIERROR::ERR_AREA_NOT_CLEAR
   185 	 * @exception AIError::ERR_AREA_NOT_CLEAR
   189 	 * @return True if and only if the tile was demolished.
   186 	 * @return True if and only if the tile was demolished.
   190 	 */
   187 	 */
   191 	static bool DemolishTile(TileIndex tile);
   188 	static bool DemolishTile(TileIndex tile);
   192 };
   189 };
   193 
   190