summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_industrytype.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-03-30 20:48:10 +0000
committerfrosch <frosch@openttd.org>2009-03-30 20:48:10 +0000
commitf55be81e3c8031cffd229b0347f2268fe0a1eafd (patch)
treef0de1a132f0bdff1175626a0d737372ae7590d8e /src/ai/api/ai_industrytype.cpp
parent3bbf0fc87b34ccab4f3bb91e1690981aecd80c7d (diff)
downloadopenttd-f55be81e3c8031cffd229b0347f2268fe0a1eafd.tar.xz
(svn r15901) -Add: AIIndustryType::IsBuiltOnWater(), HasHeliport() and HasDock(). Just like AIIndustry.
Diffstat (limited to 'src/ai/api/ai_industrytype.cpp')
-rw-r--r--src/ai/api/ai_industrytype.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ai/api/ai_industrytype.cpp b/src/ai/api/ai_industrytype.cpp
index 83d356a3c..cc2e2abae 100644
--- a/src/ai/api/ai_industrytype.cpp
+++ b/src/ai/api/ai_industrytype.cpp
@@ -111,3 +111,24 @@
uint32 seed = ::InteractiveRandom();
return AIObject::DoCommand(0, industry_type, seed, CMD_BUILD_INDUSTRY);
}
+
+/* static */ bool AIIndustryType::IsBuiltOnWater(IndustryType industry_type)
+{
+ if (!IsValidIndustryType(industry_type)) return false;
+
+ return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0;
+}
+
+/* static */ bool AIIndustryType::HasHeliport(IndustryType industry_type)
+{
+ if (!IsValidIndustryType(industry_type)) return false;
+
+ return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
+}
+
+/* static */ bool AIIndustryType::HasDock(IndustryType industry_type)
+{
+ if (!IsValidIndustryType(industry_type)) return false;
+
+ return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
+}