src/ai/api/ai_industrylist_valuator.hpp
author truelight
Sun, 19 Aug 2007 13:31:04 +0000
branchnoai
changeset 9698 1d50fe99b7e9
parent 9655 e8e43f333832
child 9710 ba44f8c1fd52
permissions -rw-r--r--
(svn r10939) [NoAI] -Add: added AITileList valuator Water
[NoAI] -Add: added AITile::IsWater
/* $Id$ */

/** @file ai_industrylist_valuator.hpp all the valuators for industrylist */

#ifndef AI_INDUSTRYLIST_VALUATOR_HPP
#define AI_INDUSTRYLIST_VALUATOR_HPP

#include "ai_abstractlist.hpp"

/**
 * Get the production of the cargo for entries in an AIIndustryList instance.
 * @note resulting items are of the type int32
 * @note the input items are of the type IndustryID
 */
class AIIndustryListProduction : public AIAbstractList::Valuator {
public:
	/**
	 * The name of the class, needed by several sub-processes.
	 */
	static const char *GetClassName() { return "AIIndustryListProduction"; }

	/**
	 * Custom constructor, we want a cargo-type as parameter.
	 */
	AIIndustryListProduction(CargoID cargo_type) { this->cargo_type = cargo_type; }

private:
	CargoID cargo_type;

	int32 Valuate(int32 industry) const;
};

/**
 * Get the location for entries in an AIIndustryList instance.
 * @note resulting items are of the type TileIndex
 * @note the input items are of the type IndustryID
 */
class AIIndustryListLocation : public AIAbstractList::Valuator {
public:
	/**
	 * The name of the class, needed by several sub-processes.
	 */
	static const char *GetClassName() { return "AIIndustryListGetLocation"; }

private:
	int32 Valuate(int32 industry) const;
};

/**
 * Get the manhattan distance to a tile for entries in an AIIndustryList instance.
 * @note resulting items are of the type distance
 * @note the input items are of the type TileIndex
 */
class AIIndustryListDistanceManhattanToTile : public AIAbstractList::Valuator {
public:
	/**
	 * The name of the class, needed by several sub-processes.
	 */
	static const char *GetClassName() { return "AIIndustryListDistanceManhattanToTile"; }

	/**
	 * Custom constructor, we want a tile as parameter.
	 */
	AIIndustryListDistanceManhattanToTile(TileIndex tile) { this->tile = tile; }

private:
	TileIndex tile;

	int32 Valuate(int32 station) const;
};

/**
 * Get the sqsuare distance to a tile for entries in an AIIndustryList instance.
 * @note resulting items are of the type distance
 * @note the input items are of the type TileIndex
 */
class AIIndustryListDistanceSquareToTile : public AIAbstractList::Valuator {
public:
	/**
	 * The name of the class, needed by several sub-processes.
	 */
	static const char *GetClassName() { return "AIIndustryListDistanceSquareToTile"; }

	/**
	 * Custom constructor, we want a tile as parameter.
	 */
	AIIndustryListDistanceSquareToTile(TileIndex tile) { this->tile = tile; }

private:
	TileIndex tile;

	int32 Valuate(int32 station) const;
};

#endif /* AI_INDUSTRYLIST_VALUATOR_HPP */