/* $Id$ */
/** @file ai_stationlist_valuator.hpp all the valuators for AIStationList */
#ifndef AI_STATIONLIST_VALUATOR_HPP
#define AI_STATIONLIST_VALUATOR_HPP
#include "ai_abstractlist.hpp"
/**
* Get the location for entries in an AIStationList instance.
* @note Resulting items are of the type TileIndex.
* @note Can only operate on an AIStationList instance.
* @ingroup AIStationList
*/
class AIStationList_vLocation : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIStationList_vGetLocation"; }
private:
const char *GetListName() const { return "AIStationList"; }
int32 Valuate(int32 station_id) const;
};
/**
* Get the cargo-waiting for entries in an AIStationList instance.
* @note Resulting items are of the type uint32 (units of cargo).
* @note Can only operate on an AIStationList instance.
* @ingroup AIStationList
*/
class AIStationList_vCargoWaiting : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIStationList_vCargoWaiting"; }
/**
* @param cargo_id The cargo of which you want to get the amount of units waiting for.
*/
AIStationList_vCargoWaiting(CargoID cargo_id) :
cargo_id(cargo_id)
{}
private:
CargoID cargo_id;
const char *GetListName() const { return "AIStationList"; }
int32 Valuate(int32 station_id) const;
};
/**
* Get the cargo rating for entries in an AIStationList instance.
* @note Resulting items are of the type int32 (percent).
* @note Can only operate on an AIStationList instance.
* @ingroup AIStationList
*/
class AIStationList_vCargoRating : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIStationList_vCargoRating"; }
/**
* @param cargo_id The cargo of which you want to get the rating of.
*/
AIStationList_vCargoRating(CargoID cargo_id) :
cargo_id(cargo_id)
{}
private:
CargoID cargo_id;
const char *GetListName() const { return "AIStationList"; }
int32 Valuate(int32 station_id) const;
};
/**
* Get the manhattan distance to a tile for entries in an AIStationList instance.
* @note Resulting items are of the type uint32.
* @note Can only operate on an AIStationList instance.
* @ingroup AIStationList
*/
class AIStationList_vDistanceManhattanToTile : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIStationList_vDistanceManhattanToTile"; }
/**
* @param tile The tile to get the distances to.
*/
AIStationList_vDistanceManhattanToTile(TileIndex tile) :
tile(tile)
{}
private:
TileIndex tile;
const char *GetListName() const { return "AIStationList"; }
int32 Valuate(int32 station_id) const;
};
/**
* Get the square distance to a tile for entries in an AIStationList instance.
* @note Resulting items are of the type uint32.
* @note Can only operate on an AIStationList instance.
* @ingroup AIStationList
*/
class AIStationList_vDistanceSquareToTile : public AIAbstractList::Valuator {
public:
static const char *GetClassName() { return "AIStationList_vDistanceSquareToTile"; }
/**
* @param tile The tile to get the distances to.
*/
AIStationList_vDistanceSquareToTile(TileIndex tile) :
tile(tile)
{}
private:
TileIndex tile;
const char *GetListName() const { return "AIStationList"; }
int32 Valuate(int32 station_id) const;
};
#endif /* AI_STATIONLIST_VALUATOR_HPP */