#include <ai_industry.hpp>
Static Public Member Functions | |
static const char * | GetClassName () |
static int32 | GetIndustryCount () |
Gets the number of industries. | |
static bool | IsValidIndustry (IndustryID industry_id) |
Checks whether the given industry index is valid. | |
static char * | GetName (IndustryID industry_id) |
Get the name of the industry. | |
static bool | IsCargoAccepted (IndustryID industry_id, CargoID cargo_id) |
See if an industry accepts a certain cargo. | |
static int32 | GetStockpiledCargo (IndustryID industry_id, CargoID cargo_id) |
Get the amount of cargo stockpiled for processing. | |
static int32 | GetLastMonthProduction (IndustryID industry_id, CargoID cargo_id) |
Get the total last month's production of the given cargo at an industry. | |
static int32 | GetLastMonthTransported (IndustryID industry_id, CargoID cargo_id) |
Get the total amount of cargo transported from an industry last month. | |
static TileIndex | GetLocation (IndustryID industry_id) |
Gets the location of the industry. | |
static int32 | GetAmountOfStationsAround (IndustryID industry_id) |
Get the number of stations around an industry. | |
static int32 | GetDistanceManhattanToTile (IndustryID industry_id, TileIndex tile) |
Get the manhattan distance from the tile to the AIIndustry::GetLocation() of the industry. | |
static int32 | GetDistanceSquareToTile (IndustryID industry_id, TileIndex tile) |
Get the square distance from the tile to the AIIndustry::GetLocation() of the industry. | |
static bool | IsBuiltOnWater (IndustryID industry_id) |
Is this industry built on water. | |
static bool | HasHeliport (IndustryID industry_id) |
Does this industry have a heliport? | |
static TileIndex | GetHeliportLocation (IndustryID industry_id) |
Gets the location of the industry's heliport. | |
static bool | HasDock (IndustryID industry_id) |
Does this industry have a dock? | |
static TileIndex | GetDockLocation (IndustryID industry_id) |
Gets the location of the industry's dock. | |
static IndustryType | GetIndustryType (IndustryID industry_id) |
Get the IndustryType of the industry. |
Definition at line 13 of file ai_industry.hpp.
int32 AIIndustry::GetIndustryCount | ( | ) | [static] |
Gets the number of industries.
Definition at line 14 of file ai_industry.cpp.
bool AIIndustry::IsValidIndustry | ( | IndustryID | industry_id | ) | [static] |
Checks whether the given industry index is valid.
industry_id | The index to check. |
Definition at line 19 of file ai_industry.cpp.
References IsValidIndustryID().
Referenced by AICargoList_IndustryAccepting::AICargoList_IndustryAccepting(), AICargoList_IndustryProducing::AICargoList_IndustryProducing(), AITileList_IndustryAccepting::AITileList_IndustryAccepting(), AITileList_IndustryProducing::AITileList_IndustryProducing(), GetAmountOfStationsAround(), GetDistanceManhattanToTile(), GetDistanceSquareToTile(), GetDockLocation(), GetHeliportLocation(), GetIndustryType(), GetLastMonthProduction(), GetLastMonthTransported(), GetLocation(), GetName(), GetStockpiledCargo(), HasDock(), HasHeliport(), IsBuiltOnWater(), and IsCargoAccepted().
char * AIIndustry::GetName | ( | IndustryID | industry_id | ) | [static] |
Get the name of the industry.
industry_id | The industry to get the name of. |
Definition at line 24 of file ai_industry.cpp.
References IsValidIndustry().
bool AIIndustry::IsCargoAccepted | ( | IndustryID | industry_id, | |
CargoID | cargo_id | |||
) | [static] |
See if an industry accepts a certain cargo.
industry_id | The index of the industry. | |
cargo_id | The index of the cargo. |
AICargo::IsValidCargo(cargo_id).
Definition at line 36 of file ai_industry.cpp.
References Industry::accepts_cargo, AICargo::IsValidCargo(), IsValidIndustry(), and lengthof.
int32 AIIndustry::GetStockpiledCargo | ( | IndustryID | industry_id, | |
CargoID | cargo_id | |||
) | [static] |
Get the amount of cargo stockpiled for processing.
industry_id | The index of the industry. | |
cargo_id | The index of the cargo. |
AICargo::IsValidCargo(cargo_id).
Definition at line 50 of file ai_industry.cpp.
References Industry::accepts_cargo, Industry::incoming_cargo_waiting, AICargo::IsValidCargo(), IsValidIndustry(), and lengthof.
int32 AIIndustry::GetLastMonthProduction | ( | IndustryID | industry_id, | |
CargoID | cargo_id | |||
) | [static] |
Get the total last month's production of the given cargo at an industry.
industry_id | The index of the industry. | |
cargo_id | The index of the cargo. |
AICargo::IsValidCargo(cargo_id).
Definition at line 66 of file ai_industry.cpp.
References AICargo::IsValidCargo(), IsValidIndustry(), Industry::last_month_production, lengthof, and Industry::produced_cargo.
int32 AIIndustry::GetLastMonthTransported | ( | IndustryID | industry_id, | |
CargoID | cargo_id | |||
) | [static] |
Get the total amount of cargo transported from an industry last month.
industry_id | The index of the industry. | |
cargo_id | The index of the cargo. |
AICargo::IsValidCargo(cargo_id).
Definition at line 80 of file ai_industry.cpp.
References AICargo::IsValidCargo(), IsValidIndustry(), Industry::last_month_transported, lengthof, and Industry::produced_cargo.
TileIndex AIIndustry::GetLocation | ( | IndustryID | industry_id | ) | [static] |
Gets the location of the industry.
industry_id | The index of the industry. |
Definition at line 94 of file ai_industry.cpp.
References INVALID_TILE, and IsValidIndustry().
Referenced by GetDistanceManhattanToTile(), and GetDistanceSquareToTile().
int32 AIIndustry::GetAmountOfStationsAround | ( | IndustryID | industry_id | ) | [static] |
Get the number of stations around an industry.
All stations that can service the industry are counted, your own stations but also your opponents stations.
industry_id | The index of the industry. |
Definition at line 101 of file ai_industry.cpp.
References FindStationsAroundTiles(), Industry::height, IsValidIndustry(), Industry::width, and Industry::xy.
int32 AIIndustry::GetDistanceManhattanToTile | ( | IndustryID | industry_id, | |
TileIndex | tile | |||
) | [static] |
Get the manhattan distance from the tile to the AIIndustry::GetLocation() of the industry.
industry_id | The industry to get the distance to. | |
tile | The tile to get the distance to. |
AIMap::IsValidTile(tile).
Definition at line 111 of file ai_industry.cpp.
References AIMap::DistanceManhattan(), GetLocation(), and IsValidIndustry().
int32 AIIndustry::GetDistanceSquareToTile | ( | IndustryID | industry_id, | |
TileIndex | tile | |||
) | [static] |
Get the square distance from the tile to the AIIndustry::GetLocation() of the industry.
industry_id | The industry to get the distance to. | |
tile | The tile to get the distance to. |
AIMap::IsValidTile(tile).
Definition at line 118 of file ai_industry.cpp.
References AIMap::DistanceSquare(), GetLocation(), and IsValidIndustry().
bool AIIndustry::IsBuiltOnWater | ( | IndustryID | industry_id | ) | [static] |
Is this industry built on water.
industry_id | The index of the industry. |
Definition at line 125 of file ai_industry.cpp.
References GetIndustrySpec(), INDUSTRYBEH_BUILT_ONWATER, and IsValidIndustry().
bool AIIndustry::HasHeliport | ( | IndustryID | industry_id | ) | [static] |
Does this industry have a heliport?
industry_id | The index of the industry. |
Definition at line 132 of file ai_industry.cpp.
References GetIndustrySpec(), INDUSTRYBEH_AI_AIRSHIP_ROUTES, and IsValidIndustry().
Referenced by GetHeliportLocation().
TileIndex AIIndustry::GetHeliportLocation | ( | IndustryID | industry_id | ) | [static] |
Gets the location of the industry's heliport.
industry_id | The index of the industry. |
HasHeliport(industry_id).
Definition at line 139 of file ai_industry.cpp.
References BEGIN_TILE_LOOP, END_TILE_LOOP, HasHeliport(), Industry::height, INVALID_TILE, IsTileType(), IsValidIndustry(), MP_STATION, Industry::width, and Industry::xy.
bool AIIndustry::HasDock | ( | IndustryID | industry_id | ) | [static] |
Does this industry have a dock?
industry_id | The index of the industry. |
Definition at line 154 of file ai_industry.cpp.
References GetIndustrySpec(), INDUSTRYBEH_AI_AIRSHIP_ROUTES, and IsValidIndustry().
Referenced by GetDockLocation().
TileIndex AIIndustry::GetDockLocation | ( | IndustryID | industry_id | ) | [static] |
Gets the location of the industry's dock.
industry_id | The index of the industry. |
HasDock(industry_id).
Definition at line 161 of file ai_industry.cpp.
References BEGIN_TILE_LOOP, END_TILE_LOOP, HasDock(), Industry::height, INVALID_TILE, IsTileType(), IsValidIndustry(), MP_STATION, Industry::width, and Industry::xy.
IndustryType AIIndustry::GetIndustryType | ( | IndustryID | industry_id | ) | [static] |
Get the IndustryType of the industry.
industry_id | The index of the industry. |
Definition at line 176 of file ai_industry.cpp.
References INVALID_INDUSTRYTYPE, and IsValidIndustry().