truelight@9592: /* $Id$ */ truelight@9592: rubidium@9595: /** @file ai_tilelist_valuator.hpp all the valuators for tilelist */ truelight@9592: truelight@9592: #ifndef AI_TILELIST_VALUATOR_HPP truelight@9592: #define AI_TILELIST_VALUATOR_HPP truelight@9592: truelight@9593: #include "ai_abstractlist.hpp" truelight@9592: truelight@9592: /** truelight@9603: * Check if tiles are buildable for entries in an AITileList instance. truelight@9592: * @note resulting items are of the type bool (0 = not buildable, 1 = buildable) truelight@9592: * @note the input items are of the type TileIndex truelight@9592: */ truelight@9593: class AITileListBuildable : public AIAbstractList::Valuator { truelight@9592: public: truelight@9592: /** truelight@9592: * The name of the class, needed by several sub-processes. truelight@9592: */ truelight@9592: static const char *GetClassName() { return "AITileListBuildable"; } truelight@9592: truelight@9592: private: truelight@9592: int32 Valuate(int32 tile) const; truelight@9592: }; truelight@9592: truelight@9603: /** truelight@9657: * Check if tiles are buildable in a rectangle around entries in an AITileList instance, with the entry in the list as top-left. truelight@9657: * @note resulting items are of the type bool (0 = not buildable, 1 = buildable) truelight@9657: * @note the input items are of the type TileIndex truelight@9657: */ truelight@9657: class AITileListBuildableRectangle : public AIAbstractList::Valuator { truelight@9657: public: truelight@9657: /** truelight@9657: * The name of the class, needed by several sub-processes. truelight@9657: */ truelight@9657: static const char *GetClassName() { return "AITileListBuildableRectangle"; } truelight@9657: truelight@9669: /** truelight@9669: * Custom constructor, we want a width and height as parameter. truelight@9669: */ truelight@9657: AITileListBuildableRectangle(uint width, uint height) { this->width = width; this->height = height; } truelight@9657: truelight@9657: private: truelight@9657: uint width, height; truelight@9657: truelight@9657: int32 Valuate(int32 tile) const; truelight@9657: }; truelight@9657: truelight@9657: /** truelight@9611: * Check how tiles in an AITileList instance are sloped. truelight@9611: * @note resulting items are of the type int32 (0 = flat, > 1 = slope) truelight@9611: * @note the input items are of the type TileIndex truelight@9611: */ truelight@9611: class AITileListSlope : public AIAbstractList::Valuator { truelight@9611: public: truelight@9611: /** truelight@9611: * The name of the class, needed by several sub-processes. truelight@9611: */ truelight@9611: static const char *GetClassName() { return "AITileListSlope"; } truelight@9611: truelight@9611: private: truelight@9611: int32 Valuate(int32 tile) const; truelight@9611: }; truelight@9611: truelight@9611: /** truelight@9617: * Count the neighbour tiles which have a piece of road of tiles in AITileList. truelight@9603: * @note resulting items are of the type int32 (the amount of neighbour road tiles) truelight@9603: * @note the input items are of the type TileIndex truelight@9603: */ truelight@9617: class AITileListNeighbourRoadCount : public AIAbstractList::Valuator { truelight@9603: public: truelight@9603: /** truelight@9603: * The name of the class, needed by several sub-processes. truelight@9603: */ truelight@9603: static const char *GetClassName() { return "AITileListNeighbourRoad"; } truelight@9603: truelight@9603: private: truelight@9603: int32 Valuate(int32 tile) const; truelight@9603: }; truelight@9603: truelight@9603: /** truelight@9603: * Check if the tiles in AITileList have a piece of road on them. truelight@9603: * @note resulting items are of the type bool (0 = no road, 1 = road) truelight@9603: * @note the input items are of the type TileIndex truelight@9603: */ truelight@9603: class AITileListRoadTile : public AIAbstractList::Valuator { truelight@9603: public: truelight@9603: /** truelight@9603: * The name of the class, needed by several sub-processes. truelight@9603: */ truelight@9603: static const char *GetClassName() { return "AITileListRoadTile"; } truelight@9603: truelight@9603: private: truelight@9603: int32 Valuate(int32 tile) const; truelight@9603: }; truelight@9603: truelight@9609: /** truelight@9609: * Get the amount of estimated accepted cargo for all tiles in AITileList. truelight@9609: * If this value is >= 8, it means it will accept this cargo. For passengers truelight@9609: * and mail it is also a good indicator how much cargo would be brought to truelight@9609: * the station. truelight@9609: * @post values < 8 means this tile does not accept this cargo. truelight@9609: * @note resulting items are of the type int32 (indicating acceptance) truelight@9609: * @note the input items are of the type TileIndex truelight@9609: */ truelight@9609: class AITileListCargoAcceptance : public AIAbstractList::Valuator { truelight@9609: public: truelight@9609: /** truelight@9609: * The name of the class, needed by several sub-processes. truelight@9609: */ truelight@9609: static const char *GetClassName() { return "AITileListCargoAcceptance"; } truelight@9609: truelight@9609: /** truelight@9609: * Custom constructor, we want a cargo-type as parameter. truelight@9609: */ truelight@9658: AITileListCargoAcceptance(CargoID cargo_type, uint width, uint height, uint radius) { this->cargo_type = cargo_type; this->width = width; this->height = height; this->radius = radius; } truelight@9609: truelight@9609: private: truelight@9609: CargoID cargo_type; truelight@9658: uint width, height, radius; truelight@9609: truelight@9609: int32 Valuate(int32 tile) const; truelight@9609: }; truelight@9609: truelight@9655: /** truelight@9655: * Get the manhattan distance to a tile for entries in an AITileList instance. truelight@9655: * @note resulting items are of the type distance truelight@9655: * @note the input items are of the type TileIndex truelight@9655: */ truelight@9655: class AITileListDistanceManhattanToTile : public AIAbstractList::Valuator { truelight@9655: public: truelight@9655: /** truelight@9655: * The name of the class, needed by several sub-processes. truelight@9655: */ truelight@9655: static const char *GetClassName() { return "AITileListDistanceManhattanToTile"; } truelight@9655: truelight@9655: /** truelight@9655: * Custom constructor, we want a tile as parameter. truelight@9655: */ truelight@9655: AITileListDistanceManhattanToTile(TileIndex tile) { this->tile = tile; } truelight@9655: truelight@9655: private: truelight@9655: TileIndex tile; truelight@9655: truelight@9655: int32 Valuate(int32 station) const; truelight@9655: }; truelight@9655: truelight@9655: /** truelight@9655: * Get the sqsuare distance to a tile for entries in an AITileList instance. truelight@9655: * @note resulting items are of the type distance truelight@9655: * @note the input items are of the type TileIndex truelight@9655: */ truelight@9655: class AITileListDistanceSquareToTile : public AIAbstractList::Valuator { truelight@9655: public: truelight@9655: /** truelight@9655: * The name of the class, needed by several sub-processes. truelight@9655: */ truelight@9655: static const char *GetClassName() { return "AITileListDistanceSquareToTile"; } truelight@9655: truelight@9655: /** truelight@9655: * Custom constructor, we want a tile as parameter. truelight@9655: */ truelight@9655: AITileListDistanceSquareToTile(TileIndex tile) { this->tile = tile; } truelight@9655: truelight@9655: private: truelight@9655: TileIndex tile; truelight@9655: truelight@9655: int32 Valuate(int32 station) const; truelight@9655: }; truelight@9655: truelight@9655: truelight@9592: #endif /* AI_TILELIST_VALUATOR_HPP */