--- a/src/ai/api/ai_station.hpp Sun Jun 08 13:56:35 2008 +0000
+++ b/src/ai/api/ai_station.hpp Sun Jun 08 14:00:40 2008 +0000
@@ -40,6 +40,7 @@
* Type of stations known in the game.
*/
enum StationType {
+ /* Values are important, as they represent the internal state of the game. */
STATION_ANY = 0x00, //!< All station types
STATION_TRAIN = 0x01, //!< Train station
STATION_TRUCK_STOP = 0x02, //!< Truck station
@@ -112,7 +113,7 @@
/**
* Get the coverage radius of this type of station.
- * @param type The type of station.
+ * @param station_type The type of station.
* @return The radius in tiles.
*/
static int32 GetCoverageRadius(AIStation::StationType station_type);
--- a/src/ai/api/ai_town.cpp Sun Jun 08 13:56:35 2008 +0000
+++ b/src/ai/api/ai_town.cpp Sun Jun 08 14:00:40 2008 +0000
@@ -152,17 +152,17 @@
extern uint GetMaskOfTownActions(int *nump, PlayerID pid, const Town *t);
-/* static */ bool AITown::IsActionAvailable(TownID town_id, TownAction action)
+/* static */ bool AITown::IsActionAvailable(TownID town_id, TownAction town_action)
{
if (!IsValidTown(town_id)) return false;
- return HasBit(::GetMaskOfTownActions(NULL, _current_player, ::GetTown(town_id)), action);
+ return HasBit(::GetMaskOfTownActions(NULL, _current_player, ::GetTown(town_id)), town_action);
}
-/* static */ bool AITown::PerformTownAction(TownID town_id, TownAction action)
+/* static */ bool AITown::PerformTownAction(TownID town_id, TownAction town_action)
{
EnforcePrecondition(false, IsValidTown(town_id));
- EnforcePrecondition(false, IsActionAvailable(town_id, action));
+ EnforcePrecondition(false, IsActionAvailable(town_id, town_action));
- return AIObject::DoCommand(::GetTown(town_id)->xy, town_id, action, CMD_DO_TOWN_ACTION);
+ return AIObject::DoCommand(::GetTown(town_id)->xy, town_id, town_action, CMD_DO_TOWN_ACTION);
}
--- a/src/ai/api/ai_town.hpp Sun Jun 08 13:56:35 2008 +0000
+++ b/src/ai/api/ai_town.hpp Sun Jun 08 14:00:40 2008 +0000
@@ -19,6 +19,8 @@
* Actions that one can perform on a town.
*/
enum TownAction {
+ /* Values are important, as they represent the internal state of the game. */
+
/**
* The cargo ratings temporary gains 25% of rating (in
* absolute percentage, so 10% becomes 35%, with a max of 99%)
@@ -228,20 +230,21 @@
/**
* Find out if an action can currently be performed on the town.
* @param town_id The town to perform the action on.
+ * @param town_action The action to perform on the town.
* @pre IsValidTown(town_id).
* @return True if and only if the action can performed.
*/
- static bool IsActionAvailable(TownID town_id, TownAction action);
+ static bool IsActionAvailable(TownID town_id, TownAction town_action);
/**
* Perform a town action on this town.
* @param town_id The town to perform the action on.
- * @param action The action to perform on the town.
+ * @param town_action The action to perform on the town.
* @pre IsValidTown(town_id).
- * @pre IsActionAvailable(town_id, action).
+ * @pre IsActionAvailable(town_id, town_action).
* @return True if the action succeeded.
*/
- static bool PerformTownAction(TownID town_id, TownAction action);
+ static bool PerformTownAction(TownID town_id, TownAction town_action);
};
#endif /* AI_TOWN_HPP */