diff -r 9646f7e37c31 -r be51ea0adc29 src/ai/api/ai_tile.hpp --- a/src/ai/api/ai_tile.hpp Tue Mar 25 12:09:42 2008 +0000 +++ b/src/ai/api/ai_tile.hpp Tue Mar 25 12:12:45 2008 +0000 @@ -59,6 +59,17 @@ static bool IsBuildable(TileIndex tile); /** + * Check if this tile is buildable in a rectangle around a tile, with the entry in the list as top-left. + * @note Road and rail are considered buildable. + * @param tile the tile to check on. + * @param width the width of the rectangle. + * @param height the height of the rectangle. + * @pre AIMap::IsValidTile(tile). + * @return true if it is buildable, false if not. + */ + static bool IsBuildableRectangle(TileIndex tile, uint width, uint height); + + /** * Check if a tile is water. * @param tile the tile to check on. * @pre AIMap::IsValidTile(tile). @@ -112,6 +123,22 @@ static int32 GetCargoProduction(TileIndex tile, CargoID cargo_type, uint width, uint height, uint radius); /** + * Get the manhattan distance from the tile to the tile. + * @param tile_from The tile to get the distance to. + * @param tile_to The tile to get the distance to. + * @return The distance between the two tiles. + */ + static int32 GetDistanceManhattanToTile(TileIndex tile_from, TileIndex tile_to); + + /** + * Get the square distance from the tile to the tile. + * @param tile_from The tile to get the distance to. + * @param tile_to The tile to get the distance to. + * @return The distance between the two tiles. + */ + static int32 GetDistanceSquareToTile(TileIndex tile_from, TileIndex tile_to); + + /** * Raise the given corners of the tile. The corners can be combined, * for example: SLOPE_N | SLOPE_W (= SLOPE_NW) * @param tile the tile to raise.