diff -r ad3c5f807d7c -r 769496a7b02e src/ai/api/ai_tilelist_valuator.hpp --- a/src/ai/api/ai_tilelist_valuator.hpp Mon Feb 25 18:18:35 2008 +0000 +++ b/src/ai/api/ai_tilelist_valuator.hpp Tue Feb 26 10:47:22 2008 +0000 @@ -128,7 +128,7 @@ }; /** - * Get the amount of estimated accepted cargo for all tiles in AITileList_v. + * Get the amount of estimated accepted cargo for all tiles in AITileList. * If this value is >= 8, it means it will accept this cargo. For passengers * and mail it is also a good indicator how much cargo would be brought to * the station. @@ -156,6 +156,33 @@ }; /** + * Get the amount of tiles producing cargo for all tiles in AITileList. + * This counts the tiles that produce this cargo. It doesn't give any + * indication about the amount it will be producing. + * @note town(houses) are not included in the value. + * @note resulting items are of the type int32 (indicating tiles of production). + * @note the input items are of the type TileIndex. + */ +class AITileList_vCargoProduction : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AITileList_vCargoProduction"; } + + /** + * Custom constructor, we want a cargo-type as parameter. + */ + AITileList_vCargoProduction(CargoID cargo_type, uint width, uint height, uint radius) { this->cargo_type = cargo_type; this->width = width; this->height = height; this->radius = radius; } + +private: + CargoID cargo_type; + uint width, height, radius; + + int32 Valuate(int32 tile) const; +}; + +/** * Get the manhattan distance to a tile for entries in an AITileList instance. * @note resulting items are of the type distance * @note the input items are of the type TileIndex