Class that handles all town related functions. More...
Public Types | |
enum | TownAction { TOWN_ACTION_ADVERTISE_SMALL = 0, TOWN_ACTION_ADVERTISE_MEDIUM = 1, TOWN_ACTION_ADVERTISE_LARGE = 2, TOWN_ACTION_ROAD_REBUILD = 3, TOWN_ACTION_BUILD_STATUE = 4, TOWN_ACTION_FUND_BUILDINGS = 5, TOWN_ACTION_BUY_RIGHTS = 6, TOWN_ACTION_BRIBE = 7 } |
Actions that one can perform on a town. More... | |
enum | TownRating { TOWN_RATING_NONE, TOWN_RATING_APPALLING, TOWN_RATING_VERY_POOR, TOWN_RATING_POOR, TOWN_RATING_MEDIOCRE, TOWN_RATING_GOOD, TOWN_RATING_VERY_GOOD, TOWN_RATING_EXCELLENT, TOWN_RATING_OUTSTANDING, TOWN_RATING_INVALID = -1 } |
Different ratings one could have in a town. More... | |
enum | RoadLayout { ROAD_LAYOUT_ORIGINAL, ROAD_LAYOUT_BETTER_ROADS, ROAD_LAYOUT_2x2, ROAD_LAYOUT_3x3, ROAD_LAYOUT_INVALID = -1 } |
Possible layouts for the roads in a town. More... | |
Static Public Member Functions | |
static int32 | GetTownCount () |
Gets the number of towns. | |
static bool | IsValidTown (TownID town_id) |
Checks whether the given town index is valid. | |
static char * | GetName (TownID town_id) |
Get the name of the town. | |
static int32 | GetPopulation (TownID town_id) |
Gets the number of inhabitants in the town. | |
static int32 | GetHouseCount (TownID town_id) |
Gets the number of houses in the town. | |
static TileIndex | GetLocation (TownID town_id) |
Gets the location of the town. | |
static int32 | GetLastMonthProduction (TownID town_id, CargoID cargo_id) |
Get the total last month's production of the given cargo at a town. | |
static int32 | GetLastMonthTransported (TownID town_id, CargoID cargo_id) |
Get the total amount of cargo transported from a town last month. | |
static int32 | GetLastMonthTransportedPercentage (TownID town_id, CargoID cargo_id) |
Get the percentage of transported production of the given cargo at a town. | |
static int32 | GetDistanceManhattanToTile (TownID town_id, TileIndex tile) |
Get the manhattan distance from the tile to the AITown::GetLocation() of the town. | |
static int32 | GetDistanceSquareToTile (TownID town_id, TileIndex tile) |
Get the square distance from the tile to the AITown::GetLocation() of the town. | |
static bool | IsWithinTownInfluence (TownID town_id, TileIndex tile) |
Find out if this tile is within the rating influence of a town. | |
static bool | HasStatue (TownID town_id) |
Find out if this town has a statue for the current company. | |
static int | GetRoadReworkDuration (TownID town_id) |
Find out how long the town is undergoing road reconstructions. | |
static AICompany::CompanyID | GetExclusiveRightsCompany (TownID town_id) |
Find out which company currently has the exclusive rights of this town. | |
static int32 | GetExclusiveRightsDuration (TownID town_id) |
Find out how long the town is under influence of the exclusive rights. | |
static bool | IsActionAvailable (TownID town_id, TownAction town_action) |
Find out if an action can currently be performed on the town. | |
static bool | PerformTownAction (TownID town_id, TownAction town_action) |
Perform a town action on this town. | |
static TownRating | GetRating (TownID town_id, AICompany::CompanyID company_id) |
Get the rating of a company within a town. | |
static int | GetAllowedNoise (TownID town_id) |
Get the maximum level of noise that still can be added by airports before the town start to refuse building a new airport. | |
static RoadLayout | GetRoadLayout (TownID town_id) |
Get the road layout for a town. |
Class that handles all town related functions.
enum AITown::RoadLayout |
Possible layouts for the roads in a town.
enum AITown::TownAction |
Actions that one can perform on a town.
enum AITown::TownRating |
Different ratings one could have in a town.
static int AITown::GetAllowedNoise | ( | TownID | town_id | ) | [static] |
Get the maximum level of noise that still can be added by airports before the town start to refuse building a new airport.
town_id | The town to get the allowed noise from. |
Get the manhattan distance from the tile to the AITown::GetLocation() of the town.
town_id | The town to get the distance to. | |
tile | The tile to get the distance to. |
Get the square distance from the tile to the AITown::GetLocation() of the town.
town_id | The town to get the distance to. | |
tile | The tile to get the distance to. |
static AICompany::CompanyID AITown::GetExclusiveRightsCompany | ( | TownID | town_id | ) | [static] |
Find out which company currently has the exclusive rights of this town.
town_id | The town to check. |
static int32 AITown::GetExclusiveRightsDuration | ( | TownID | town_id | ) | [static] |
Find out how long the town is under influence of the exclusive rights.
town_id | The town to check. |
static int32 AITown::GetHouseCount | ( | TownID | town_id | ) | [static] |
Gets the number of houses in the town.
town_id | The town to get the number of houses of. |
Get the total last month's production of the given cargo at a town.
town_id | The index of the town. | |
cargo_id | The index of the cargo. |
Get the total amount of cargo transported from a town last month.
town_id | The index of the industry. | |
cargo_id | The index of the cargo. |
static int32 AITown::GetLastMonthTransportedPercentage | ( | TownID | town_id, | |
CargoID | cargo_id | |||
) | [static] |
Get the percentage of transported production of the given cargo at a town.
town_id | The index of the town. | |
cargo_id | The index of the cargo. |
Gets the location of the town.
town_id | The town to get the location of. |
static char* AITown::GetName | ( | TownID | town_id | ) | [static] |
Get the name of the town.
town_id | The town to get the name of. |
static int32 AITown::GetPopulation | ( | TownID | town_id | ) | [static] |
Gets the number of inhabitants in the town.
town_id | The town to get the population of. |
static TownRating AITown::GetRating | ( | TownID | town_id, | |
AICompany::CompanyID | company_id | |||
) | [static] |
Get the rating of a company within a town.
town_id | The town to get the rating for. | |
company_id | The company to get the rating for. |
static RoadLayout AITown::GetRoadLayout | ( | TownID | town_id | ) | [static] |
Get the road layout for a town.
town_id | The town to get the road layout from. |
static int AITown::GetRoadReworkDuration | ( | TownID | town_id | ) | [static] |
Find out how long the town is undergoing road reconstructions.
town_id | The town to check. |
static int32 AITown::GetTownCount | ( | ) | [static] |
Gets the number of towns.
static bool AITown::HasStatue | ( | TownID | town_id | ) | [static] |
Find out if this town has a statue for the current company.
town_id | The town to check. |
static bool AITown::IsActionAvailable | ( | TownID | town_id, | |
TownAction | town_action | |||
) | [static] |
Find out if an action can currently be performed on the town.
town_id | The town to perform the action on. | |
town_action | The action to perform on the town. |
static bool AITown::IsValidTown | ( | TownID | town_id | ) | [static] |
Checks whether the given town index is valid.
town_id | The index to check. |
Find out if this tile is within the rating influence of a town.
Stations on this tile influence the rating of the town.
town_id | The town to check. | |
tile | The tile to check. |
static bool AITown::PerformTownAction | ( | TownID | town_id, | |
TownAction | town_action | |||
) | [static] |
Perform a town action on this town.
town_id | The town to perform the action on. | |
town_action | The action to perform on the town. |