src/ai/api/ai_bridgelist_valuator.hpp
author truebrain
Thu, 28 Feb 2008 01:11:23 +0000
branchnoai
changeset 9803 c86d5834fb11
parent 9792 e1222f4674c2
permissions -rw-r--r--
(svn r12309) [NoAI] -Codechange: optimize a little bit (a very small little bit, but every bit counts :) ) (glx)
/* $Id$ */

/** @file ai_bridgelist_valuator.hpp all the valuators for AIBridgeList */

#ifndef AI_BRIDGELIST_VALUATOR_HPP
#define AI_BRIDGELIST_VALUATOR_HPP

#include "ai_abstractlist.hpp"

/**
 * Get the maximum speed for entries in an AIBridgeList instance.
 * @note Resulting items are of the type int32.
 * @note Can only operate on an AIBridgeList instance.
 * @ingroup AIBridgeList
 */
class AIBridgeList_vMaxSpeed : public AIAbstractList::Valuator {
public:
	static const char *GetClassName() { return "AIBridgeList_vMaxSpeed"; }

private:
	const char *GetListName() const { return "AIBridgeList"; }
	int32 Valuate(int32 bridge_id) const;
};

/**
 * Get the price for entries in an AIBridgeList instance.
 * @note Resulting items are of the type int32.
 * @note Can only operate on an AIBridgeList instance.
 * @ingroup AIBridgeList
 */
class AIBridgeList_vPrice : public AIAbstractList::Valuator {
public:
	static const char *GetClassName() { return "AIBridgeList_vPrice"; }

	/**
	 * @param length The length of the bridge you want to build.
	 */
	AIBridgeList_vPrice(uint length) :
		length(length)
	{}

private:
	uint length;

	const char *GetListName() const { return "AIBridgeList"; }
	int32 Valuate(int32 bridge_id) const;
};

/**
 * Get the maximum bridge length for entries in an AIBridgeList instance.
 * @note Resulting items are of the type int32.
 * @note Can only operate on an AIBridgeList instance.
 * @ingroup AIBridgeList
 */
class AIBridgeList_vMaxLength : public AIAbstractList::Valuator {
public:
	static const char *GetClassName() { return "AIBridgeList_vMaxLength"; }

private:
	const char *GetListName() const { return "AIBridgeList"; }
	int32 Valuate(int32 bridge_id) const;
};

/**
 * Get the minimum bridge length for entries in an AIBridgeList instance.
 * @note Resulting items are of the type int32.
 * @note Can only operate on an AIBridgeList instance.
 * @ingroup AIBridgeList
 */
class AIBridgeList_vMinLength : public AIAbstractList::Valuator {
public:
	static const char *GetClassName() { return "AIBridgeList_vMinLength"; }

private:
	const char *GetListName() const { return "AIBridgeList"; }
	int32 Valuate(int32 bridge_id) const;
};

/**
 * Get the year in which the bridge will be available for all entries in an
 *  AIBridgeList instance.
 * @note Resulting items are of the type int32.
 * @note Can only operate on an AIBridgeList instance.
 * @ingroup AIBridgeList
 */
class AIBridgeList_vYearAvailable : public AIAbstractList::Valuator {
public:
	static const char *GetClassName() { return "AIBridgeList_vYearAvailable"; }

private:
	const char *GetListName() const { return "AIBridgeList"; }
	int32 Valuate(int32 bridge_id) const;
};

#endif /* AI_BRIDGELIST_VALUATOR_HPP */