author | truebrain |
Fri, 23 May 2008 08:52:29 +0000 | |
branch | noai |
changeset 10674 | 542470cee8a2 |
parent 10669 | 70a2d1f6f24b |
child 10863 | 7b31d67e1553 |
permissions | -rw-r--r-- |
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 |
|
9829
80fbe02a4184
(svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents:
9814
diff
changeset
|
3 |
/** @file ai_station.hpp Everything to query and build stations. */ |
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
|
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" |
9866
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
9 |
#include "ai_error.hpp" |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
10 |
#include "ai_road.hpp" |
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
|
11 |
|
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 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
|
14 |
*/ |
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 |
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
|
16 |
public: |
9829
80fbe02a4184
(svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents:
9814
diff
changeset
|
17 |
static const char *GetClassName() { return "AIStation"; } |
80fbe02a4184
(svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents:
9814
diff
changeset
|
18 |
|
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
|
19 |
/** |
9873
b1ab23560ecb
(svn r12606) [NoAI] -Fix: minor documentation inconsistancy, to make doxygen even more happy
truebrain
parents:
9866
diff
changeset
|
20 |
* All station related error messages. |
9866
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
21 |
*/ |
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
22 |
enum ErrorMessages { |
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
23 |
/** Base for station related errors */ |
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
24 |
ERR_STATION_BASE = AIError::ERR_CAT_STATION << AIError::ERR_CAT_BIT_SIZE, |
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
25 |
|
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
26 |
/** The station size exceeds the station spread */ |
10094
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
27 |
ERR_STATION_TOO_LARGE, // [STR_306C_STATION_TOO_SPREAD_OUT] |
9866
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
28 |
|
10094
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
29 |
/** The station is build too close to another station, airport or dock */ |
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
30 |
ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION, // [STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT, STR_3009_TOO_CLOSE_TO_ANOTHER_STATION, STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK] |
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
31 |
|
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
32 |
/** There are too many stations, airports and docks in the game */ |
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
33 |
ERR_STATION_TOO_MANY_STATIONS, // [STR_3008_TOO_MANY_STATIONS_LOADING, STR_TOO_MANY_TRUCK_STOPS, STR_TOO_MANY_BUS_STOPS] |
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
34 |
|
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
35 |
/** There are too many stations, airports of docks in a town */ |
e737405b06dd
(svn r12625) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents:
9873
diff
changeset
|
36 |
ERR_STATION_TOO_MANY_STATIONS_IN_TOWN, // [STR_3007_TOO_MANY_STATIONS_LOADING] |
9866
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
37 |
}; |
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
38 |
|
efc38e1f559a
(svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents:
9838
diff
changeset
|
39 |
/** |
9670
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
40 |
* Type of stations known in the game. |
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
41 |
*/ |
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
42 |
enum StationType { |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
43 |
STATION_ANY = 0x00, //!< All station types |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
44 |
STATION_TRAIN = 0x01, //!< Train station |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
45 |
STATION_TRUCK_STOP = 0x02, //!< Truck station |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
46 |
STATION_BUS_STOP = 0x04, //!< Bus station |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
47 |
STATION_AIRPORT = 0x08, //!< Airport |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
48 |
STATION_DOCK = 0x10, //!< Dock |
9670
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
49 |
}; |
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
50 |
|
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
51 |
/** |
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
|
52 |
* Checks whether the given station is valid and owned by you. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
53 |
* @param station_id The station to check. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
54 |
* @return True if and only if the station is valid. |
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
|
55 |
*/ |
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
|
56 |
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
|
57 |
|
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
|
58 |
/** |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
59 |
* Get the StationID of a tile, if there is a station. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
60 |
* @param tile The tile to find the stationID of |
9666
5765eb70736d
(svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents:
9648
diff
changeset
|
61 |
* @return StationID of the station. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
62 |
* @post Use IsValidStation() to see if the station is valid. |
9666
5765eb70736d
(svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents:
9648
diff
changeset
|
63 |
*/ |
5765eb70736d
(svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents:
9648
diff
changeset
|
64 |
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
|
65 |
|
5765eb70736d
(svn r10580) [NoAI] -Add: added GetStationID to get the StationID based on a tile
truelight
parents:
9648
diff
changeset
|
66 |
/** |
9696
4384ed3de1f0
(svn r10937) [NoAI] -Add: added AIStation::GetName on request by Nickman
truelight
parents:
9670
diff
changeset
|
67 |
* Get the name of a station. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
68 |
* @param station_id The station to get the name of. |
9696
4384ed3de1f0
(svn r10937) [NoAI] -Add: added AIStation::GetName on request by Nickman
truelight
parents:
9670
diff
changeset
|
69 |
* @pre IsValidStation(station_id). |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
70 |
* @return The name of the station. |
9696
4384ed3de1f0
(svn r10937) [NoAI] -Add: added AIStation::GetName on request by Nickman
truelight
parents:
9670
diff
changeset
|
71 |
*/ |
4384ed3de1f0
(svn r10937) [NoAI] -Add: added AIStation::GetName on request by Nickman
truelight
parents:
9670
diff
changeset
|
72 |
static char *GetName(StationID station_id); |
4384ed3de1f0
(svn r10937) [NoAI] -Add: added AIStation::GetName on request by Nickman
truelight
parents:
9670
diff
changeset
|
73 |
|
4384ed3de1f0
(svn r10937) [NoAI] -Add: added AIStation::GetName on request by Nickman
truelight
parents:
9670
diff
changeset
|
74 |
/** |
10381
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
75 |
* Set the name this station. |
10644
6c4314786d68
(svn r13188) [NoAI] -Fix: missed @param in doxygen comment
truebrain
parents:
10381
diff
changeset
|
76 |
* @param station_id The station to set the name of. |
10381
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
77 |
* @param name The new name of the station. |
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
78 |
* @pre IsValidStation(station_id). |
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
79 |
* @pre 'name' must have at least one character. |
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
80 |
* @exception AIError::ERR_NAME_IS_NOT_UNIQUE |
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
81 |
* @return True if the name was changed. |
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
82 |
*/ |
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
83 |
static bool SetName(StationID station_id, const char *name); |
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
84 |
|
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10361
diff
changeset
|
85 |
/** |
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
|
86 |
* Get the current location of a station. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
87 |
* @param station_id The station to get the location of. |
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
|
88 |
* @pre IsValidStation(station_id). |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
89 |
* @return The tile the station is currently on. |
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
|
90 |
*/ |
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
|
91 |
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
|
92 |
|
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
|
93 |
/** |
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
|
94 |
* See how much cargo there is waiting on a station. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
95 |
* @param station_id The station to get the cargo-waiting of. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
96 |
* @param cargo_id The cargo to get the cargo-waiting of. |
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
|
97 |
* @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
|
98 |
* @pre IsValidCargo(cargo_id). |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
99 |
* @return The amount of units waiting at the station. |
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
|
100 |
*/ |
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
|
101 |
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
|
102 |
|
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9638
diff
changeset
|
103 |
/** |
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9638
diff
changeset
|
104 |
* See how high the rating is of a cargo on a station. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
105 |
* @param station_id The station to get the cargo-rating of. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
106 |
* @param cargo_id The cargo to get the cargo-rating of. |
9648
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9638
diff
changeset
|
107 |
* @pre IsValidStation(station_id). |
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9638
diff
changeset
|
108 |
* @pre IsValidCargo(cargo_id). |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
109 |
* @return The rating in percent of the cargo on the station. |
9648
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9638
diff
changeset
|
110 |
*/ |
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9638
diff
changeset
|
111 |
static int32 GetCargoRating(StationID station_id, CargoID cargo_id); |
9670
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
112 |
|
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
113 |
/** |
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
114 |
* Get the coverage radius of this type of station. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
115 |
* @param type The type of station. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
116 |
* @return The radius in tiles. |
9670
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
117 |
*/ |
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
118 |
static int32 GetCoverageRadius(AIStation::StationType type); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
119 |
|
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
120 |
/** |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
121 |
* Get the manhattan distance from the tile to the AIStation::GetLocation() |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
122 |
* of the station. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
123 |
* @param station_id The station to get the distance to. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
124 |
* @param tile The tile to get the distance to. |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
125 |
* @pre IsValidStation(station_id). |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
126 |
* @return The distance between station and tile. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
127 |
*/ |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
128 |
static int32 GetDistanceManhattanToTile(StationID station_id, TileIndex tile); |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
129 |
|
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
130 |
/** |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
131 |
* Get the square distance from the tile to the AIStation::GetLocation() |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
132 |
* of the station. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
133 |
* @param station_id The station to get the distance to. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
134 |
* @param tile The tile to get the distance to. |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
135 |
* @pre IsValidStation(station_id). |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
136 |
* @return The distance between station and tile. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
137 |
*/ |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9696
diff
changeset
|
138 |
static int32 GetDistanceSquareToTile(StationID station_id, TileIndex tile); |
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
139 |
|
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
140 |
/** |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
141 |
* Find out if this station is within the rating influence of a town. |
10361
4cdffd48480f
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents:
10360
diff
changeset
|
142 |
* Stations within the radius influence the rating of the town. |
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
143 |
* @param station_id The station to check. |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
144 |
* @param town_id The town to check. |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
145 |
* @return True if the tile is within the rating influence of the town. |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
146 |
*/ |
10361
4cdffd48480f
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents:
10360
diff
changeset
|
147 |
static bool IsWithinTownInfluence(StationID station_id, TownID town_id); |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
148 |
|
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
149 |
/** |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
150 |
* Check if any part of the station contains a station of the type |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
151 |
* RoadType. |
10669 | 152 |
* @param station_id The station to look at. |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
153 |
* @param road_type The RoadType to look for. |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
154 |
* @return True if the station has a station part of the type RoadType. |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
155 |
*/ |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10644
diff
changeset
|
156 |
static bool HasRoadType(StationID station_id, AIRoad::RoadType road_type); |
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
|
157 |
}; |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9837
diff
changeset
|
158 |
|
9670
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9666
diff
changeset
|
159 |
DECLARE_ENUM_AS_BIT_SET(AIStation::StationType); |
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
|
160 |
|
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
|
161 |
#endif /* AI_STATION_HPP */ |