src/ai/api/ai_station.hpp
author truelight
Thu, 12 Jul 2007 15:51:19 +0000
branchnoai
changeset 9638 f6d169a5a45a
child 9648 760b7b504e37
permissions -rw-r--r--
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
/* $Id$ */

/** @file ai_station.hpp Everything to query and build stations */

#ifndef AI_STATION_HPP
#define AI_STATION_HPP

#include "ai_object.hpp"

/**
 * Class that handles all station related functions.
 */
class AIStation : public AIObject {
public:
	/**
	 * The name of the class, needed by several sub-processes.
	 */
	static const char *GetClassName() { return "AIStation"; }

	/**
	 * Checks whether the given station is valid and owned by you.
	 * @param station_id the station to check.
	 * @return true if and only if the station is valid.
	 */
	static bool IsValidStation(StationID station_id);

	/**
	 * Get the current location of a station.
	 * @param station_id the station to get the location of.
	 * @pre IsValidStation(station_id).
	 * @return the tile the station is currently on.
	 */
	static TileIndex GetLocation(StationID station_id);

	/**
	 * See how much cargo there is waiting on a station.
	 * @param station_id the station to get the cargo-waiting of.
	 * @param cargo_id the cargo to get the cargo-waiting of.
	 * @pre IsValidStation(station_id).
	 * @pre IsValidCargo(cargo_id).
	 * @return the amount of units waiting at the station.
	 */
	static int32 GetCargoWaiting(StationID station_id, CargoID cargo_id);
};

#endif /* AI_STATION_HPP */