truelight@9649: /* $Id$ */ truelight@9649: truebrain@9778: /** @file ai_industrylist_valuator.hpp all the valuators for AIIndustryList */ truelight@9649: truelight@9649: #ifndef AI_INDUSTRYLIST_VALUATOR_HPP truelight@9649: #define AI_INDUSTRYLIST_VALUATOR_HPP truelight@9649: truelight@9649: #include "ai_abstractlist.hpp" truelight@9649: truelight@9649: /** truebrain@9778: * Get the production rate of the cargo for entries in an AIIndustryList truebrain@9778: * instance. This is the amount of production you can expect in a month. truebrain@9778: * @note Resulting items are of the type int32. truebrain@9778: * @note Can only operate on an AIIndustryList instance. truebrain@9778: * @ingroup AIIndustryList truelight@9649: */ truebrain@9753: class AIIndustryList_vProduction : public AIAbstractList::Valuator { truelight@9649: public: truebrain@9753: static const char *GetClassName() { return "AIIndustryList_vProduction"; } truelight@9649: truelight@9649: /** truebrain@9778: * @param cargo_id The cargo to check the production rate of. truelight@9649: */ truebrain@9778: AIIndustryList_vProduction(CargoID cargo_id) : truebrain@9778: cargo_id(cargo_id) truebrain@9778: {} truelight@9710: truelight@9710: private: truebrain@9778: CargoID cargo_id; truelight@9710: truebrain@9772: const char *GetListName() const { return "AIIndustryList"; } truelight@9710: int32 Valuate(int32 industry) const; truelight@9710: }; truelight@9710: truelight@9710: /** truebrain@9778: * See which entries in the AIIndustryList instance accepts a given cargo. truebrain@9778: * @note Resulting items are of the type bool. truebrain@9778: * @note Can only operate on an AIIndustryList instance. truebrain@9778: * @ingroup AIIndustryList truelight@9649: */ truebrain@9753: class AIIndustryList_vCargoAccepted : public AIAbstractList::Valuator { truelight@9649: public: truebrain@9753: static const char *GetClassName() { return "AIIndustryList_vCargoAccepted"; } truebrain@9753: truebrain@9753: /** truebrain@9778: * @param cargo_id Check if this cargo is accepted. truebrain@9753: */ truebrain@9778: AIIndustryList_vCargoAccepted(CargoID cargo_id) : truebrain@9778: cargo_id(cargo_id) truebrain@9778: {} truebrain@9753: truebrain@9753: private: truebrain@9778: CargoID cargo_id; truebrain@9753: truebrain@9772: const char *GetListName() const { return "AIIndustryList"; } truebrain@9753: int32 Valuate(int32 industry) const; truebrain@9753: }; truebrain@9753: truebrain@9753: /** truebrain@9756: * Get the location for entries in an AIIndustryList instance. truebrain@9778: * @note Resulting items are of the type TileIndex. truebrain@9778: * @note Can only operate on an AIIndustryList instance. truebrain@9778: * @ingroup AIIndustryList truebrain@9753: */ truebrain@9753: class AIIndustryList_vLocation : public AIAbstractList::Valuator { truebrain@9753: public: truebrain@9753: static const char *GetClassName() { return "AIIndustryList_vGetLocation"; } truelight@9649: truelight@9649: private: truebrain@9772: const char *GetListName() const { return "AIIndustryList"; } truelight@9649: int32 Valuate(int32 industry) const; truelight@9649: }; truelight@9649: truelight@9655: /** truebrain@9756: * Get the manhattan distance to a tile for entries in an AIIndustryList instance. truebrain@9778: * @note Resulting items are of the type uint32. truebrain@9778: * @note Can only operate on an AIIndustryList instance. truebrain@9778: * @ingroup AIIndustryList truelight@9655: */ truebrain@9753: class AIIndustryList_vDistanceManhattanToTile : public AIAbstractList::Valuator { truelight@9655: public: truebrain@9753: static const char *GetClassName() { return "AIIndustryList_vDistanceManhattanToTile"; } truelight@9655: truelight@9655: /** truebrain@9778: * @param tile The tile to get the distance to. truelight@9655: */ truebrain@9778: AIIndustryList_vDistanceManhattanToTile(TileIndex tile) : truebrain@9778: tile(tile) truebrain@9778: {} truelight@9655: truelight@9655: private: truelight@9655: TileIndex tile; truelight@9655: truebrain@9772: const char *GetListName() const { return "AIIndustryList"; } truelight@9655: int32 Valuate(int32 station) const; truelight@9655: }; truelight@9655: truelight@9655: /** truebrain@9781: * Get the square distance to a tile for entries in an AIIndustryList instance. truebrain@9778: * @note Resulting items are of the type uint32. truebrain@9778: * @note Can only operate on an AIIndustryList instance. truebrain@9778: * @ingroup AIIndustryList truelight@9655: */ truebrain@9753: class AIIndustryList_vDistanceSquareToTile : public AIAbstractList::Valuator { truelight@9655: public: truebrain@9753: static const char *GetClassName() { return "AIIndustryList_vDistanceSquareToTile"; } truelight@9655: truelight@9655: /** truebrain@9778: * @param tile The tile to get the distance to. truelight@9655: */ truebrain@9778: AIIndustryList_vDistanceSquareToTile(TileIndex tile) : truebrain@9778: tile(tile) truebrain@9778: {} truelight@9655: truelight@9655: private: truelight@9655: TileIndex tile; truelight@9655: truebrain@9772: const char *GetListName() const { return "AIIndustryList"; } truelight@9655: int32 Valuate(int32 station) const; truelight@9655: }; truelight@9655: truelight@9649: #endif /* AI_INDUSTRYLIST_VALUATOR_HPP */