Index: src/ai/api/ai_industry.hpp =================================================================== --- src/ai/api/ai_industry.hpp (revision 12187) +++ src/ai/api/ai_industry.hpp (working copy) @@ -24,7 +24,7 @@ * @return the maximum industry index. * @post return value is always non-negative. */ - IndustryID GetMaxIndustryID(); + static IndustryID GetMaxIndustryID(); /** * Gets the number of industries. This is different than GetMaxIndustryID() @@ -32,7 +32,7 @@ * @return the number of industries. * @post return value is always non-negative. */ - int32 GetIndustryCount(); + static int32 GetIndustryCount(); /** * Checks whether the given industry index is valid. @@ -48,7 +48,7 @@ * @return the name of the industry. * @note the returned name must be free'd (C++ only). */ - char *GetName(IndustryID industry_id); + static char *GetName(IndustryID industry_id); /** * Gets the production of a cargo of the industry. Index: src/ai/api/ai_industry.cpp =================================================================== --- src/ai/api/ai_industry.cpp (revision 12187) +++ src/ai/api/ai_industry.cpp (working copy) @@ -8,12 +8,12 @@ #include "../../strings_func.h" #include "table/strings.h" -IndustryID AIIndustry::GetMaxIndustryID() +/* static */ IndustryID AIIndustry::GetMaxIndustryID() { return ::GetMaxIndustryIndex(); } -int32 AIIndustry::GetIndustryCount() +/* static */ int32 AIIndustry::GetIndustryCount() { return ::GetNumIndustries(); } @@ -23,9 +23,9 @@ return ::IsValidIndustryID(industry_id); } -char *AIIndustry::GetName(IndustryID industry_id) +/* static */ char *AIIndustry::GetName(IndustryID industry_id) { - if (!this->IsValidIndustry(industry_id)) return NULL; + if (!IsValidIndustry(industry_id)) return NULL; static const int len = 64; char *industry_name = MallocT(len); Index: src/ai/api/ai_industry.hpp.sq =================================================================== --- src/ai/api/ai_industry.hpp.sq (revision 12187) +++ src/ai/api/ai_industry.hpp.sq (working copy) @@ -14,15 +14,14 @@ SQAIIndustry.PreRegister(engine); SQAIIndustry.AddConstructor(engine, "x"); - SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetClassName, "GetClassName", 1, "x"); - SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsValidIndustry, "IsValidIndustry", 2, "xi"); - SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetProduction, "GetProduction", 3, "xii"); - SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsCargoAccepted, "IsCargoAccepted", 3, "xii"); - SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLocation, "GetLocation", 2, "xi"); + SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetClassName, "GetClassName", 1, "x"); + SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetMaxIndustryID, "GetMaxIndustryID", 1, "x"); + SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetIndustryCount, "GetIndustryCount", 1, "x"); + SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsValidIndustry, "IsValidIndustry", 2, "xi"); + SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetName, "GetName", 2, "xi"); + SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetProduction, "GetProduction", 3, "xii"); + SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsCargoAccepted, "IsCargoAccepted", 3, "xii"); + SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLocation, "GetLocation", 2, "xi"); - SQAIIndustry.DefSQMethod(engine, &AIIndustry::GetMaxIndustryID, "GetMaxIndustryID", 1, "x"); - SQAIIndustry.DefSQMethod(engine, &AIIndustry::GetIndustryCount, "GetIndustryCount", 1, "x"); - SQAIIndustry.DefSQMethod(engine, &AIIndustry::GetName, "GetName", 2, "xi"); - SQAIIndustry.PostRegister(engine); }