diff --git a/src/ai/api/Doxyfile b/src/ai/api/Doxyfile index ff5d7a511e..5be8606e2e 100644 --- a/src/ai/api/Doxyfile +++ b/src/ai/api/Doxyfile @@ -31,7 +31,6 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 2 diff --git a/src/ai/api/ai_event_types.hpp b/src/ai/api/ai_event_types.hpp index 6cff88f528..3c36dfc6bd 100644 --- a/src/ai/api/ai_event_types.hpp +++ b/src/ai/api/ai_event_types.hpp @@ -32,6 +32,7 @@ public: /** * @param vehicle The vehicle that crashed. * @param crash_site Where the vehicle crashed. + * @param crash_reason The reason why the vehicle crashed. */ AIEventVehicleCrashed(VehicleID vehicle, TileIndex crash_site, CrashReason crash_reason) : AIEvent(AI_ET_VEHICLE_CRASHED), diff --git a/src/ai/api/ai_object.hpp b/src/ai/api/ai_object.hpp index 8fb8968c97..40f3b920cd 100644 --- a/src/ai/api/ai_object.hpp +++ b/src/ai/api/ai_object.hpp @@ -143,9 +143,24 @@ protected: */ static void *&GetEventPointer(); + /** + * Set the cost of the last command. + */ static void SetLastCost(Money last_cost); + + /** + * Get the cost of the last command. + */ static Money GetLastCost(); + + /** + * Set a variable that can be used by callback functions to pass information. + */ static void SetCallbackVariable(int index, int value); + + /** + * Get the variable that is used by callback functions to pass information. + */ static int GetCallbackVariable(int index); public: diff --git a/src/ai/api/ai_order.hpp b/src/ai/api/ai_order.hpp index 14f20c2588..c55b5e3e8e 100644 --- a/src/ai/api/ai_order.hpp +++ b/src/ai/api/ai_order.hpp @@ -288,8 +288,10 @@ public: * Sets the OrderCondition of the given order for the given vehicle. * @param vehicle_id The vehicle to set the condition type for. * @param order_position The order to set the condition type for. + * @param condition The condition to compare on. * @pre IsValidVehicleOrder(vehicle_id, order_position). * @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position). + * @pre condition >= OC_LOAD_PERCENTAGE && condition <= OC_UNCONDITIONALLY. * @return Whether the order has been/can be changed. */ static bool SetOrderCondition(VehicleID vehicle_id, OrderPosition order_position, OrderCondition condition); @@ -298,8 +300,10 @@ public: * Sets the CompareFunction of the given order for the given vehicle. * @param vehicle_id The vehicle to set the compare function for. * @param order_position The order to set the compare function for. + * @param compare The new compare function of the order. * @pre IsValidVehicleOrder(vehicle_id, order_position). * @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position). + * @pre compare >= CF_EQUALS && compare <= CF_IS_FALSE. * @return Whether the order has been/can be changed. */ static bool SetOrderCompareFunction(VehicleID vehicle_id, OrderPosition order_position, CompareFunction compare); @@ -308,6 +312,7 @@ public: * Sets the value to compare against of the given order for the given vehicle. * @param vehicle_id The vehicle to set the value for. * @param order_position The order to set the value for. + * @param value The value to compare against. * @pre IsValidVehicleOrder(vehicle_id, order_position). * @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position). * @pre value >= 0 && value < 2048. diff --git a/src/ai/api/ai_station.hpp b/src/ai/api/ai_station.hpp index 18a1d62903..783013968d 100644 --- a/src/ai/api/ai_station.hpp +++ b/src/ai/api/ai_station.hpp @@ -49,6 +49,10 @@ public: STATION_ANY = 0x1F, //!< All station types }; + /** + * Special station IDs for building adjacent/new stations when + * the adjacent/distant join features are enabled. + */ enum SpecialStationIDs { STATION_NEW = 0xFFFD, //!< Build a new station STATION_JOIN_ADJACENT = 0xFFFE, //!< Join an neighbouring station if one exists diff --git a/src/ai/api/ai_types.hpp b/src/ai/api/ai_types.hpp index 9653cda03c..1e7812cc6b 100644 --- a/src/ai/api/ai_types.hpp +++ b/src/ai/api/ai_types.hpp @@ -8,62 +8,62 @@ * reused for other objects once they are released. So be careful, which IDs you store for which purpose and whether they stay valid all the time. * *
type | object | - *acquired | - *released | - *reused |
---|---|---|---|---|
#BridgeID | bridge type | - *introduction \ref newgrf_changes "(1)" | - *never \ref newgrf_changes "(1)" | - *no \ref newgrf_changes "(1)" |
#CargoID | cargo type | - *game start \ref newgrf_changes "(1)" | - *never \ref newgrf_changes "(1)" | - *no \ref newgrf_changes "(1)" |
#EngineID | engine type | - *introduction, preview \ref dynamic_engines "(2)" | - *engines retires \ref dynamic_engines "(2)" | - *no \ref dynamic_engines "(2)" |
#GroupID | vehicle group | - *creation | - *deletion | - *yes |
#IndustyID | industry | - *construction | - *closure | - *yes |
#IndustyType | industry type | - *game start \ref newgrf_changes "(1)" | - *never \ref newgrf_changes "(1)" | - *no |
#SignID | sign | - *construction | - *deletion | - *yes |
#StationID | station | - *construction | - *expiration of 'grey' station sign after deletion | - *yes |
#SubsidyID | subsidy | - *offer announcement | - *(offer) expiration | - *yes |
#TileIndex | tile on map | - *game start | - *never | - *no |
#TownID | town | - *game start | - *never | - *no |
#VehicleID | vehicle | - *construction, autorenew, autoreplace | - *destruction, autorenew, autoreplace | - *yes |
#WaypointID | waypoint | - *construction | - *destruction | - *yes |
type | object | + *acquired | + *released | + *reused |
#BridgeID | bridge type | + *introduction \ref newgrf_changes "(1)" | + *never \ref newgrf_changes "(1)" | + *no \ref newgrf_changes "(1)" |
#CargoID | cargo type | + *game start \ref newgrf_changes "(1)" | + *never \ref newgrf_changes "(1)" | + *no \ref newgrf_changes "(1)" |
#EngineID | engine type | + *introduction, preview \ref dynamic_engines "(2)" | + *engines retires \ref dynamic_engines "(2)" | + *no \ref dynamic_engines "(2)" |
#GroupID | vehicle group | + *creation | + *deletion | + *yes |
#IndustryID | industry | + *construction | + *closure | + *yes |
#IndustryType | industry type | + *game start \ref newgrf_changes "(1)" | + *never \ref newgrf_changes "(1)" | + *no |
#SignID | sign | + *construction | + *deletion | + *yes |
#StationID | station | + *construction | + *expiration of 'grey' station sign after deletion | + *yes |
#SubsidyID | subsidy | + *offer announcement | + *(offer) expiration | + *yes |
#TileIndex | tile on map | + *game start | + *never | + *no |
#TownID | town | + *game start | + *never | + *no |
#VehicleID | vehicle | + *construction, autorenew, autoreplace | + *destruction, autorenew, autoreplace | + *yes |
#WaypointID | waypoint | + *construction | + *destruction | + *yes |