From 7fdde2fec0f3038ef0c85218ba55ed83f082a8c1 Mon Sep 17 00:00:00 2001 From: yexo Date: Sat, 14 Feb 2009 21:05:57 +0000 Subject: (svn r15483) -Change [API CHANGE]: Remove AIIndustry::GetProduction, use AIIndustry::GetLastMonthProduction instead. --- src/ai/api/ai_industry.cpp | 14 -------------- src/ai/api/ai_industry.hpp | 15 --------------- src/ai/api/ai_industry.hpp.sq | 1 - 3 files changed, 30 deletions(-) (limited to 'src/ai/api') diff --git a/src/ai/api/ai_industry.cpp b/src/ai/api/ai_industry.cpp index 6876b270b..6ef383672 100644 --- a/src/ai/api/ai_industry.cpp +++ b/src/ai/api/ai_industry.cpp @@ -38,20 +38,6 @@ return industry_name; } -/* static */ int32 AIIndustry::GetProduction(IndustryID industry_id, CargoID cargo_id) -{ - if (!IsValidIndustry(industry_id)) return -1; - if (!AICargo::IsValidCargo(cargo_id)) return -1; - - const Industry *i = ::GetIndustry(industry_id); - - for (byte j = 0; j < lengthof(i->produced_cargo); j++) { - if (i->produced_cargo[j] == cargo_id) return i->production_rate[j] * 8; - } - - return -1; -} - /* static */ bool AIIndustry::IsCargoAccepted(IndustryID industry_id, CargoID cargo_id) { if (!IsValidIndustry(industry_id)) return false; diff --git a/src/ai/api/ai_industry.hpp b/src/ai/api/ai_industry.hpp index 471df937a..11d3dbc43 100644 --- a/src/ai/api/ai_industry.hpp +++ b/src/ai/api/ai_industry.hpp @@ -45,21 +45,6 @@ public: */ static char *GetName(IndustryID industry_id); - /** - * Gets the production of a cargo of the industry. - * @warning This function does not neccessarily return useful values for newindustries. - * An industry produces at least the returned amount per month, - * but the function can also return 0, when the industry produces lots of cargo. - * GetLastMonthProduction() is more robust. - * @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. diff --git a/src/ai/api/ai_industry.hpp.sq b/src/ai/api/ai_industry.hpp.sq index 1c694e9d0..399ed384e 100644 --- a/src/ai/api/ai_industry.hpp.sq +++ b/src/ai/api/ai_industry.hpp.sq @@ -21,7 +21,6 @@ void SQAIIndustry_Register(Squirrel *engine) { SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetIndustryCount, "GetIndustryCount", 1, "?"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsValidIndustry, "IsValidIndustry", 2, "?i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetName, "GetName", 2, "?i"); - SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetProduction, "GetProduction", 3, "?ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsCargoAccepted, "IsCargoAccepted", 3, "?ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetStockpiledCargo, "GetStockpiledCargo", 3, "?ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLastMonthProduction, "GetLastMonthProduction", 3, "?ii"); -- cgit v1.2.3-54-g00ecf