truelight@9617: /* $Id$ */ truelight@9617: truelight@9617: /** @file ai_tile.hpp tile related functions */ truelight@9617: truelight@9617: #ifndef AI_TILE_HPP truelight@9617: #define AI_TILE_HPP truelight@9617: truelight@9617: #include "ai_abstractlist.hpp" truelight@9617: truelight@9617: /** truelight@9617: * Class that handles all tile related functions. truelight@9617: */ truelight@9617: class AITile : public AIObject { truelight@9617: public: truelight@9617: /** truelight@9617: * The name of the class, needed by several sub-processes. truelight@9617: */ truelight@9617: static const char *GetClassName() { return "AITile"; } truelight@9617: truelight@9617: /** truelight@9617: * Check if this tile is buildable (e.g.: no things on it that needs removing). truelight@9617: * @note Road and rail are considered buildable. truelight@9617: * @pre tile is always positive and smaller than AIMap::GetMapSize(). truelight@9617: * @param tile the tile to check on. truelight@9617: * @return true if it is buildable, false if not. truelight@9617: */ truelight@9617: static bool IsBuildable(TileIndex tile); truelight@9617: truelight@9617: /** truelight@9617: * Get the slope of a tile. truelight@9617: * @pre tile is always positive and smaller than AIMap::GetMapSize(). truelight@9617: * @param tile the tile to check on. truelight@9617: * @return 0 means flat, others indicate internal state of slope. truelight@9617: */ truelight@9617: static int32 GetSlope(TileIndex tile); truelight@9617: truelight@9617: /** truelight@9617: * Check how much cargo this tile accepts. truelight@9617: * It creates a radius around the tile and adds up all acceptance of this truelight@9617: * cargo and returns that value. truelight@9617: * @pre tile is always positive and smaller than AIMap::GetMapSize(). truelight@9617: * @param tile the tile to check on. truelight@9619: * @param cargo_type the cargo to check the acceptance of. truelight@9658: * @param width the width of the station. truelight@9658: * @param height the height of the station. truelight@9658: * @param radius the radius of the station. truelight@9617: * @return value below 8 means no acceptance; the more the better. truelight@9617: */ truelight@9658: static int32 GetCargoAcceptance(TileIndex tile, CargoID cargo_type, uint width, uint height, uint radius); truelight@9617: }; truelight@9617: truelight@9617: #endif /* AI_TILE_HPP */