src/ai/api/ai_station.hpp
author truelight
Sun, 15 Jul 2007 12:56:41 +0000
branchnoai
changeset 9666 5765eb70736d
parent 9648 760b7b504e37
child 9670 820b77e19bb3
permissions -rw-r--r--
(svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     1
/* $Id$ */
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     2
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     3
/** @file ai_station.hpp Everything to query and build stations */
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     4
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     5
#ifndef AI_STATION_HPP
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     6
#define AI_STATION_HPP
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     7
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     8
#include "ai_object.hpp"
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
     9
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    10
/**
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    11
 * Class that handles all station related functions.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    12
 */
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    13
class AIStation : public AIObject {
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    14
public:
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    15
	/**
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    16
	 * The name of the class, needed by several sub-processes.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    17
	 */
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    18
	static const char *GetClassName() { return "AIStation"; }
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    19
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    20
	/**
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    21
	 * Checks whether the given station is valid and owned by you.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    22
	 * @param station_id the station to check.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    23
	 * @return true if and only if the station is valid.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    24
	 */
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    25
	static bool IsValidStation(StationID station_id);
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    26
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    27
	/**
9666
5765eb70736d (svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents: 9648
diff changeset
    28
	 * Get the stationID of a tile, if there is a station.
5765eb70736d (svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents: 9648
diff changeset
    29
	 * @param tile the tile to find the stationID of
5765eb70736d (svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents: 9648
diff changeset
    30
	 * @return StationID of the station.
5765eb70736d (svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents: 9648
diff changeset
    31
	 * @post use IsValidStation to see if the station is valid.
5765eb70736d (svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents: 9648
diff changeset
    32
	 */
5765eb70736d (svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents: 9648
diff changeset
    33
	static StationID GetStationID(TileIndex tile);
5765eb70736d (svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents: 9648
diff changeset
    34
5765eb70736d (svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents: 9648
diff changeset
    35
	/**
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    36
	 * Get the current location of a station.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    37
	 * @param station_id the station to get the location of.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    38
	 * @pre IsValidStation(station_id).
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    39
	 * @return the tile the station is currently on.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    40
	 */
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    41
	static TileIndex GetLocation(StationID station_id);
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    42
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    43
	/**
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    44
	 * See how much cargo there is waiting on a station.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    45
	 * @param station_id the station to get the cargo-waiting of.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    46
	 * @param cargo_id the cargo to get the cargo-waiting of.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    47
	 * @pre IsValidStation(station_id).
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    48
	 * @pre IsValidCargo(cargo_id).
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    49
	 * @return the amount of units waiting at the station.
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    50
	 */
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    51
	static int32 GetCargoWaiting(StationID station_id, CargoID cargo_id);
9648
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    52
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    53
	/**
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    54
	 * See how high the rating is of a cargo on a station.
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    55
	 * @param station_id the station to get the cargo-rating of.
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    56
	 * @param cargo_id the cargo to get the cargo-rating of.
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    57
	 * @pre IsValidStation(station_id).
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    58
	 * @pre IsValidCargo(cargo_id).
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    59
	 * @return the rating in percent of the cargo on the station.
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    60
	 */
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9638
diff changeset
    61
	static int32 GetCargoRating(StationID station_id, CargoID cargo_id);
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    62
};
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    63
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
diff changeset
    64
#endif /* AI_STATION_HPP */