diff -r 2541c2d325ed -r 54afebfded49 src/ai/api/ai_industry.hpp --- a/src/ai/api/ai_industry.hpp Mon Mar 31 07:21:39 2008 +0000 +++ b/src/ai/api/ai_industry.hpp Mon Mar 31 07:37:51 2008 +0000 @@ -18,91 +18,90 @@ /** * Gets the maximum industry index; there are no valid industries with a * higher index. - * @return the maximum industry index. - * @post return value is always non-negative. + * @return The maximum industry index. + * @post Return value is always non-negative. */ static IndustryID GetMaxIndustryID(); /** * Gets the number of industries. This is different than GetMaxIndustryID() * because of the way OpenTTD works internally. - * @return the number of industries. - * @post return value is always non-negative. + * @return The number of industries. + * @post Return value is always non-negative. */ static int32 GetIndustryCount(); /** * Checks whether the given industry index is valid. - * @param industry_id the index to check. - * @return true if and only if the industry is valid. + * @param industry_id The index to check. + * @return True if and only if the industry is valid. */ static bool IsValidIndustry(IndustryID industry_id); /** * Get the name of the industry. - * @param industry_id the industry to get the name of. - * @pre industry_id has to be valid (use IsValidIndustry()). - * @return the name of the industry. - * @note the returned name must be free'd (C++ only). + * @param industry_id The industry to get the name of. + * @pre IsValidIndustry(industry_id). + * @return The name of the industry. */ static char *GetName(IndustryID industry_id); /** * Gets the production of a cargo of the industry. - * @param industry_id the index of the industry. - * @param cargo_id the index of the cargo. - * @pre industry_id has to be valid (use IsValidIndustry()). - * @pre cargo_id has to be valid (use IsValidCargo()). - * @return the production of the cargo for this industry, or -1 if + * @param industry_id The index of the industry. + * @param cargo_id The index of the cargo. + * @pre IsValidIndustry(industry_id). + * @pre AICargo::IsValidCargo(cargo_id). + * @return The production of the cargo for this industry, or -1 if * this industry doesn't produce this cargo. */ static int32 GetProduction(IndustryID industry_id, CargoID cargo_id); /** * See if an industry accepts a certain cargo. - * @param industry_id the index of the industry. - * @param cargo_id the index of the cargo. - * @pre industry_id has to be valid (use IsValidIndustry()). - * @pre cargo_id has to be valid (use IsValidCargo()). - * @return the production of the cargo for this industry. + * @param industry_id The index of the industry. + * @param cargo_id The index of the cargo. + * @pre IsValidIndustry(industry_id). + * @pre AICargo::IsValidCargo(cargo_id). + * @return The production of the cargo for this industry. */ static bool IsCargoAccepted(IndustryID industry_id, CargoID cargo_id); /** - * Gets the location of the industry. - * @param industry_id the index of the industry. - * @pre industry_id has to be valid (use IsValidIndustry()). - * @return the location of the industry. - * @post return value is always valid with AIMap::IsValidTile(). - */ - static TileIndex GetLocation(IndustryID industry_id); - - - /** * Get the total last month's production of the given cargo at an industry. - * @param industry_id the index of the industry. - * @param cargo_id the index of the cargo. - * @pre industry_id has to be valid (use IsValidIndustry()). - * @pre cargo_id has to be valid (use IsValidCargo()). - * @return the last month's production of the given cargo for this industry. + * @param industry_id The index of the industry. + * @param cargo_id The index of the cargo. + * @pre IsValidIndustry(industry_id). + * @pre AICargo::IsValidCargo(cargo_id). + * @return The last month's production of the given cargo for this industry. */ static uint16 GetLastMonthProduction(IndustryID industry_id, CargoID cargo_id); /** * Get the total amount of cargo transported from an industry last month. - * @param industry_id the index of the industry. - * @param cargo_id the index of the cargo. - * @pre industry_id has to be valid (use IsValidIndustry()). - * @pre cargo_id has to be valid (use IsValidCargo()). - * @return the amount of given cargo transported from this industry last month. + * @param industry_id The index of the industry. + * @param cargo_id The index of the cargo. + * @pre IsValidIndustry(industry_id). + * @pre AICargo::IsValidCargo(cargo_id). + * @return The amount of given cargo transported from this industry last month. */ static uint16 GetLastMonthTransported(IndustryID industry_id, CargoID cargo_id); /** + * Gets the location of the industry. + * @param industry_id The index of the industry. + * @pre IsValidIndustry(industry_id). + * @return The location of the industry. + */ + static TileIndex GetLocation(IndustryID industry_id); + + /** * Get the manhattan distance from the tile to the AIIndustry::GetLocation() * of the industry. * @param industry_id The industry to get the distance to. * @param tile The tile to get the distance to. + * @pre IsValidIndustry(industry_id). + * @pre AIMap::IsValidTile(tile). * @return The distance between industry and tile. */ static int32 GetDistanceManhattanToTile(IndustryID industry_id, TileIndex tile); @@ -112,6 +111,8 @@ * of the industry. * @param industry_id The industry to get the distance to. * @param tile The tile to get the distance to. + * @pre IsValidIndustry(industry_id). + * @pre AIMap::IsValidTile(tile). * @return The distance between industry and tile. */ static int32 GetDistanceSquareToTile(IndustryID industry_id, TileIndex tile);