Class that handles all industry-type related functions. More...
#include <script_industrytype.hpp>
Public Types | |
enum | SpecialIndustryType { INDUSTRYTYPE_UNKNOWN = 0xFE, INDUSTRYTYPE_TOWN = 0xFF } |
Special IndustryTypes. More... | |
Static Public Member Functions | |
static bool | IsValidIndustryType (IndustryType industry_type) |
Checks whether the given industry-type is valid. | |
static char * | GetName (IndustryType industry_type) |
Get the name of an industry-type. | |
static ScriptList * | GetProducedCargo (IndustryType industry_type) |
Get a list of CargoID possible produced by this industry-type. | |
static ScriptList * | GetAcceptedCargo (IndustryType industry_type) |
Get a list of CargoID accepted by this industry-type. | |
static bool | IsRawIndustry (IndustryType industry_type) |
Is this industry type a raw industry? | |
static bool | ProductionCanIncrease (IndustryType industry_type) |
Can the production of this industry increase? | |
static Money | GetConstructionCost (IndustryType industry_type) |
Get the cost for building this industry-type. | |
static bool | CanBuildIndustry (IndustryType industry_type) |
Can you build this type of industry? | |
static bool | CanProspectIndustry (IndustryType industry_type) |
Can you prospect this type of industry? | |
static bool | BuildIndustry (IndustryType industry_type, TileIndex tile) |
Build an industry of the specified type. | |
static bool | ProspectIndustry (IndustryType industry_type) |
Prospect an industry of this type. | |
static bool | IsBuiltOnWater (IndustryType industry_type) |
Is this type of industry built on water. | |
static bool | HasHeliport (IndustryType industry_type) |
Does this type of industry have a heliport? | |
static bool | HasDock (IndustryType industry_type) |
Does this type of industry have a dock? |
Class that handles all industry-type related functions.
ai game
Definition at line 21 of file script_industrytype.hpp.
Special IndustryTypes.
INDUSTRYTYPE_UNKNOWN |
Unknown/unspecific industrytype. (Usable for ScriptRail::BuildNewGRFRailStation()). |
INDUSTRYTYPE_TOWN |
No industry, but town. (Usable for ScriptRail::BuildNewGRFRailStation()). |
Definition at line 26 of file script_industrytype.hpp.
bool ScriptIndustryType::BuildIndustry | ( | IndustryType | industry_type, | |
TileIndex | tile | |||
) | [static] |
Build an industry of the specified type.
industry_type | The type of the industry to build. | |
tile | The tile to build the industry on. |
Definition at line 112 of file script_industrytype.cpp.
References CanBuildIndustry(), CMD_BUILD_INDUSTRY, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), GetIndustrySpec(), ScriptMap::IsValidTile(), and OWNER_DEITY.
bool ScriptIndustryType::CanBuildIndustry | ( | IndustryType | industry_type | ) | [static] |
Can you build this type of industry?
industry_type | The type of the industry. |
Definition at line 90 of file script_industrytype.cpp.
References _settings_game, GameSettings::construction, GetIndustryProbabilityCallback(), GetIndustrySpec(), IACT_USERCREATION, IsRawIndustry(), IsValidIndustryType(), and ConstructionSettings::raw_industry_construction.
Referenced by BuildIndustry().
bool ScriptIndustryType::CanProspectIndustry | ( | IndustryType | industry_type | ) | [static] |
Can you prospect this type of industry?
industry_type | The type of the industry. |
Definition at line 101 of file script_industrytype.cpp.
References _settings_game, GameSettings::construction, GetIndustryProbabilityCallback(), GetIndustrySpec(), IACT_USERCREATION, IsRawIndustry(), IsValidIndustryType(), and ConstructionSettings::raw_industry_construction.
Referenced by ProspectIndustry().
ScriptList * ScriptIndustryType::GetAcceptedCargo | ( | IndustryType | industry_type | ) | [static] |
Get a list of CargoID accepted by this industry-type.
industry_type | The type to get the CargoIDs for. |
Definition at line 76 of file script_industrytype.cpp.
References IndustrySpec::accepts_cargo, CT_INVALID, GetIndustrySpec(), IsValidIndustryType(), and lengthof.
Money ScriptIndustryType::GetConstructionCost | ( | IndustryType | industry_type | ) | [static] |
Get the cost for building this industry-type.
industry_type | The type of the industry. |
Definition at line 43 of file script_industrytype.cpp.
References _settings_game, GameSettings::construction, IndustrySpec::GetConstructionCost(), GetIndustrySpec(), IsRawIndustry(), IsValidIndustryType(), and ConstructionSettings::raw_industry_construction.
char * ScriptIndustryType::GetName | ( | IndustryType | industry_type | ) | [static] |
Get the name of an industry-type.
industry_type | The type to get the name for. |
Definition at line 51 of file script_industrytype.cpp.
References GetIndustrySpec(), and IsValidIndustryType().
ScriptList * ScriptIndustryType::GetProducedCargo | ( | IndustryType | industry_type | ) | [static] |
Get a list of CargoID possible produced by this industry-type.
industry_type | The type to get the CargoIDs for. |
Definition at line 62 of file script_industrytype.cpp.
References CT_INVALID, GetIndustrySpec(), IsValidIndustryType(), and lengthof.
bool ScriptIndustryType::HasDock | ( | IndustryType | industry_type | ) | [static] |
Does this type of industry have a dock?
industry_type | The type of the industry. |
Definition at line 145 of file script_industrytype.cpp.
References GetIndustrySpec(), INDUSTRYBEH_AI_AIRSHIP_ROUTES, and IsValidIndustryType().
bool ScriptIndustryType::HasHeliport | ( | IndustryType | industry_type | ) | [static] |
Does this type of industry have a heliport?
industry_type | The type of the industry. |
Definition at line 138 of file script_industrytype.cpp.
References GetIndustrySpec(), INDUSTRYBEH_AI_AIRSHIP_ROUTES, and IsValidIndustryType().
bool ScriptIndustryType::IsBuiltOnWater | ( | IndustryType | industry_type | ) | [static] |
Is this type of industry built on water.
industry_type | The type of the industry. |
Definition at line 131 of file script_industrytype.cpp.
References GetIndustrySpec(), INDUSTRYBEH_BUILT_ONWATER, and IsValidIndustryType().
bool ScriptIndustryType::IsRawIndustry | ( | IndustryType | industry_type | ) | [static] |
Is this industry type a raw industry?
industry_type | The type of the industry. |
Definition at line 28 of file script_industrytype.cpp.
References GetIndustrySpec(), IndustrySpec::IsRawIndustry(), and IsValidIndustryType().
Referenced by CanBuildIndustry(), CanProspectIndustry(), and GetConstructionCost().
bool ScriptIndustryType::IsValidIndustryType | ( | IndustryType | industry_type | ) | [static] |
Checks whether the given industry-type is valid.
industry_type | The type check. |
Definition at line 21 of file script_industrytype.cpp.
References IndustrySpec::enabled, GetIndustrySpec(), and NUM_INDUSTRYTYPES.
Referenced by ScriptRail::BuildNewGRFRailStation(), CanBuildIndustry(), CanProspectIndustry(), GetAcceptedCargo(), GetConstructionCost(), GetName(), GetProducedCargo(), HasDock(), HasHeliport(), IsBuiltOnWater(), IsRawIndustry(), and ProductionCanIncrease().
bool ScriptIndustryType::ProductionCanIncrease | ( | IndustryType | industry_type | ) | [static] |
Can the production of this industry increase?
industry_type | The type of the industry. |
Definition at line 35 of file script_industrytype.cpp.
References _settings_game, GameSettings::game_creation, GetIndustrySpec(), INDUSTRYBEH_DONT_INCR_PROD, IsValidIndustryType(), and GameCreationSettings::landscape.
bool ScriptIndustryType::ProspectIndustry | ( | IndustryType | industry_type | ) | [static] |
Prospect an industry of this type.
Prospecting an industries let the game try to create an industry on a random place on the map.
industry_type | The type of the industry. |
Definition at line 122 of file script_industrytype.cpp.
References CanProspectIndustry(), CMD_BUILD_INDUSTRY, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), and OWNER_DEITY.