(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
/* $Id$ */
/** @file ai_industrylist_valuator.hpp all the valuators for AIIndustryList */
#ifndef AI_INDUSTRYLIST_VALUATOR_HPP
#define AI_INDUSTRYLIST_VALUATOR_HPP
#include "ai_abstractlist.hpp"
/**
* Get the production rate of the cargo for entries in an AIIndustryList
* instance. This is the amount of production you can expect in a month.
* @note Resulting items are of the type int32.
* @note Can only operate on an AIIndustryList instance.
* @ingroup AIIndustryList
*/
class AIIndustryList_vProduction : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIIndustryList_vProduction"; }
/**
* @param cargo_id The cargo to check the production rate of.
*/
AIIndustryList_vProduction(CargoID cargo_id) :
cargo_id(cargo_id)
{}
private:
CargoID cargo_id;
const char *GetListName() const { return "AIIndustryList"; }
int32 Valuate(int32 industry) const;
};
/**
* See which entries in the AIIndustryList instance accepts a given cargo.
* @note Resulting items are of the type bool.
* @note Can only operate on an AIIndustryList instance.
* @ingroup AIIndustryList
*/
class AIIndustryList_vCargoAccepted : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIIndustryList_vCargoAccepted"; }
/**
* @param cargo_id Check if this cargo is accepted.
*/
AIIndustryList_vCargoAccepted(CargoID cargo_id) :
cargo_id(cargo_id)
{}
private:
CargoID cargo_id;
const char *GetListName() const { return "AIIndustryList"; }
int32 Valuate(int32 industry) const;
};
/**
* Get the location for entries in an AIIndustryList instance.
* @note Resulting items are of the type TileIndex.
* @note Can only operate on an AIIndustryList instance.
* @ingroup AIIndustryList
*/
class AIIndustryList_vLocation : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIIndustryList_vGetLocation"; }
private:
const char *GetListName() const { return "AIIndustryList"; }
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 uint32.
* @note Can only operate on an AIIndustryList instance.
* @ingroup AIIndustryList
*/
class AIIndustryList_vDistanceManhattanToTile : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIIndustryList_vDistanceManhattanToTile"; }
/**
* @param tile The tile to get the distance to.
*/
AIIndustryList_vDistanceManhattanToTile(TileIndex tile) :
tile(tile)
{}
private:
TileIndex tile;
const char *GetListName() const { return "AIIndustryList"; }
int32 Valuate(int32 station) const;
};
/**
* Get the square distance to a tile for entries in an AIIndustryList instance.
* @note Resulting items are of the type uint32.
* @note Can only operate on an AIIndustryList instance.
* @ingroup AIIndustryList
*/
class AIIndustryList_vDistanceSquareToTile : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIIndustryList_vDistanceSquareToTile"; }
/**
* @param tile The tile to get the distance to.
*/
AIIndustryList_vDistanceSquareToTile(TileIndex tile) :
tile(tile)
{}
private:
TileIndex tile;
const char *GetListName() const { return "AIIndustryList"; }
int32 Valuate(int32 station) const;
};
#endif /* AI_INDUSTRYLIST_VALUATOR_HPP */