truelight@9589: /* $Id$ */ truelight@9589: rubidium@9595: /** @file ai_townlist_valuator.hpp all the valuators for townlist */ truelight@9589: truelight@9589: #ifndef AI_TOWNLIST_VALUATOR_HPP truelight@9589: #define AI_TOWNLIST_VALUATOR_HPP truelight@9589: truelight@9593: #include "ai_abstractlist.hpp" truelight@9589: truelight@9589: /** truelight@9660: * Give a random value for the entries in an AITownList instance. truelight@9660: * @note resulting items are of the type int32 truelight@9660: * @note the input items are of the type TownID truelight@9660: */ truelight@9660: class AITownListRandomize : public AIAbstractList::Valuator { truelight@9660: public: truelight@9660: /** truelight@9660: * The name of the class, needed by several sub-processes. truelight@9660: */ truelight@9660: static const char *GetClassName() { return "AITownListRandomize"; } truelight@9660: truelight@9660: private: truelight@9660: int32 Valuate(int32 town) const; truelight@9660: }; truelight@9660: truelight@9660: /** truelight@9589: * Get the population for entries in an AITownList instance. truelight@9589: * @note resulting items are of the type int32 truelight@9589: * @note the input items are of the type TownID truelight@9589: */ truelight@9616: class AITownListPopulation : public AIAbstractList::Valuator { truelight@9589: public: truelight@9589: /** truelight@9589: * The name of the class, needed by several sub-processes. truelight@9589: */ truelight@9589: static const char *GetClassName() { return "AITownListGetPopulation"; } truelight@9589: truelight@9589: private: truelight@9589: int32 Valuate(int32 town) const; truelight@9589: }; truelight@9589: truelight@9589: /** truelight@9589: * Get the location for entries in an AITownList instance. truelight@9589: * @note resulting items are of the type TileIndex truelight@9589: * @note the input items are of the type TownID truelight@9589: */ truelight@9616: class AITownListLocation : public AIAbstractList::Valuator { truelight@9589: public: truelight@9589: /** truelight@9589: * The name of the class, needed by several sub-processes. truelight@9589: */ truelight@9589: static const char *GetClassName() { return "AITownListGetLocation"; } truelight@9589: truelight@9589: private: truelight@9589: int32 Valuate(int32 town) const; truelight@9589: }; truelight@9589: truelight@9655: /** truelight@9655: * Get the manhattan distance to a tile for entries in an AITownList instance. truelight@9655: * @note resulting items are of the type distance truelight@9655: * @note the input items are of the type TownID truelight@9655: */ truelight@9655: class AITownListDistanceManhattanToTile : 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 "AITownListDistanceManhattanToTile"; } truelight@9655: truelight@9655: /** truelight@9655: * Custom constructor, we want a tile as parameter. truelight@9655: */ truelight@9655: AITownListDistanceManhattanToTile(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 AITownList instance. truelight@9655: * @note resulting items are of the type distance truelight@9655: * @note the input items are of the type TownID truelight@9655: */ truelight@9655: class AITownListDistanceSquareToTile : 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 "AITownListDistanceSquareToTile"; } truelight@9655: truelight@9655: /** truelight@9655: * Custom constructor, we want a tile as parameter. truelight@9655: */ truelight@9655: AITownListDistanceSquareToTile(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@9589: #endif /* AI_TOWNLIST_VALUATOR_HPP */