6 #include "ai_cargo.hpp" |
6 #include "ai_cargo.hpp" |
7 #include "../../industry.h" |
7 #include "../../industry.h" |
8 #include "../../strings_func.h" |
8 #include "../../strings_func.h" |
9 #include "table/strings.h" |
9 #include "table/strings.h" |
10 |
10 |
11 IndustryID AIIndustry::GetMaxIndustryID() |
11 /* static */ IndustryID AIIndustry::GetMaxIndustryID() |
12 { |
12 { |
13 return ::GetMaxIndustryIndex(); |
13 return ::GetMaxIndustryIndex(); |
14 } |
14 } |
15 |
15 |
16 int32 AIIndustry::GetIndustryCount() |
16 /* static */ int32 AIIndustry::GetIndustryCount() |
17 { |
17 { |
18 return ::GetNumIndustries(); |
18 return ::GetNumIndustries(); |
19 } |
19 } |
20 |
20 |
21 /* static */ bool AIIndustry::IsValidIndustry(IndustryID industry_id) |
21 /* static */ bool AIIndustry::IsValidIndustry(IndustryID industry_id) |
22 { |
22 { |
23 return ::IsValidIndustryID(industry_id); |
23 return ::IsValidIndustryID(industry_id); |
24 } |
24 } |
25 |
25 |
26 char *AIIndustry::GetName(IndustryID industry_id) |
26 /* static */ char *AIIndustry::GetName(IndustryID industry_id) |
27 { |
27 { |
28 if (!IsValidIndustry(industry_id)) return NULL; |
28 if (!IsValidIndustry(industry_id)) return NULL; |
29 static const int len = 64; |
29 static const int len = 64; |
30 char *industry_name = MallocT<char>(len); |
30 char *industry_name = MallocT<char>(len); |
31 |
31 |