OpenTTD Source 20241224-master-gf74b0cf984
HouseSpec Struct Reference

Public Member Functions

HouseID Index () const
 Gets the index of this spec.
 
Money GetRemovalCost () const
 Get the cost for removing this house.
 

Static Public Member Functions

static std::vector< HouseSpec > & Specs ()
 Get a reference to all HouseSpecs.
 
static HouseSpecGet (size_t house_id)
 Get the spec for a house ID.
 

Data Fields

TimerGameCalendar::Year min_year
 introduction year of the house
 
TimerGameCalendar::Year max_year
 last year it can be built
 
uint8_t population
 population (Zero on other tiles in multi tile house.)
 
uint8_t removal_cost
 cost multiplier for removing it
 
StringID building_name
 building name
 
uint16_t remove_rating_decrease
 rating decrease if removed
 
uint8_t mail_generation
 mail generation multiplier (tile based, as the acceptances below)
 
uint8_t cargo_acceptance [HOUSE_NUM_ACCEPTS]
 acceptance level for the cargo slots
 
CargoID accepts_cargo [HOUSE_NUM_ACCEPTS]
 input cargo slots
 
BuildingFlags building_flags
 some flags that describe the house (size, stadium etc...)
 
HouseZones building_availability
 where can it be built (climates, zones)
 
bool enabled
 the house is available to build (true by default, but can be disabled by newgrf)
 
GRFFileProps grf_prop
 Properties related the the grf file.
 
uint16_t callback_mask
 Bitmask of house callbacks that have to be called.
 
Colours random_colour [4]
 4 "random" colours
 
uint8_t probability
 Relative probability of appearing (16 is the standard value)
 
HouseExtraFlags extra_flags
 some more flags
 
HouseClassID class_id
 defines the class this house has (not grf file based)
 
AnimationInfo animation
 information about the animation.
 
uint8_t processing_time
 Periodic refresh multiplier.
 
uint8_t minimum_life
 The minimum number of years this house will survive before the town rebuilds it.
 
CargoTypes watched_cargoes
 Cargo types watched for acceptance.
 
CargoLabel accepts_cargo_label [HOUSE_ORIGINAL_NUM_ACCEPTS]
 input landscape cargo slots
 

Detailed Description

Definition at line 93 of file house.h.

Member Function Documentation

◆ Get()

◆ GetRemovalCost()

Money HouseSpec::GetRemovalCost ( ) const

Get the cost for removing this house.

Returns
The cost adjusted for inflation, etc.

Definition at line 225 of file town_cmd.cpp.

References removal_cost.

Referenced by ClearTile_Town().

◆ Index()

HouseID HouseSpec::Index ( ) const

Gets the index of this spec.

Returns
The index.

Definition at line 59 of file newgrf_house.cpp.

Referenced by GetAcceptedCargoOfHouse(), GetHouseName(), BuildHouseWindow::OnPlaceObject(), and TryBuildTownHouse().

◆ Specs()

Field Documentation

◆ accepts_cargo

CargoID HouseSpec::accepts_cargo[HOUSE_NUM_ACCEPTS]

input cargo slots

Definition at line 103 of file house.h.

Referenced by AddAcceptedCargoOfHouse(), and FinaliseHouseArray().

◆ accepts_cargo_label

CargoLabel HouseSpec::accepts_cargo_label[HOUSE_ORIGINAL_NUM_ACCEPTS]

input landscape cargo slots

Definition at line 120 of file house.h.

Referenced by FinaliseHouseArray().

◆ animation

AnimationInfo HouseSpec::animation

information about the animation.

Definition at line 115 of file house.h.

◆ building_availability

HouseZones HouseSpec::building_availability

where can it be built (climates, zones)

Definition at line 105 of file house.h.

Referenced by EnsureEarlyHouse(), HousePickerCallbacks::FillUsedItems(), HousePickerCallbacks::GetTypeName(), IsHouseSpecValid(), and TryBuildTownHouse().

◆ building_flags

BuildingFlags HouseSpec::building_flags

◆ building_name

StringID HouseSpec::building_name

building name

Definition at line 99 of file house.h.

Referenced by GetHouseName().

◆ callback_mask

uint16_t HouseSpec::callback_mask

Bitmask of house callbacks that have to be called.

Definition at line 110 of file house.h.

Referenced by AddAcceptedCargoOfHouse(), DrawNewHouseTileInGUI(), GetFoundation_Town(), TileLoop_Town(), and TryBuildTownHouse().

◆ cargo_acceptance

uint8_t HouseSpec::cargo_acceptance[HOUSE_NUM_ACCEPTS]

acceptance level for the cargo slots

Definition at line 102 of file house.h.

Referenced by AddAcceptedCargoOfHouse(), and FinaliseHouseArray().

◆ class_id

HouseClassID HouseSpec::class_id

defines the class this house has (not grf file based)

Definition at line 114 of file house.h.

Referenced by DecreaseBuildingCount(), HouseScopeResolver::GetVariable(), IncreaseBuildingCount(), SearchNearbyHouseClass(), and TryBuildTownHouse().

◆ enabled

bool HouseSpec::enabled

the house is available to build (true by default, but can be disabled by newgrf)

Definition at line 106 of file house.h.

Referenced by EnsureEarlyHouse(), HousePickerCallbacks::GetTypeName(), IsHouseSpecValid(), HousePickerCallbacks::IsTypeAvailable(), TownHouseChangeInfo(), and TryBuildTownHouse().

◆ extra_flags

HouseExtraFlags HouseSpec::extra_flags

some more flags

Definition at line 113 of file house.h.

Referenced by TryBuildTownHouse().

◆ grf_prop

◆ mail_generation

uint8_t HouseSpec::mail_generation

mail generation multiplier (tile based, as the acceptances below)

Definition at line 101 of file house.h.

Referenced by TileLoop_Town().

◆ max_year

TimerGameCalendar::Year HouseSpec::max_year

last year it can be built

Definition at line 96 of file house.h.

Referenced by BuildHouseWindow::GetHouseInformation(), and TryBuildTownHouse().

◆ min_year

TimerGameCalendar::Year HouseSpec::min_year

introduction year of the house

Definition at line 95 of file house.h.

Referenced by EnsureEarlyHouse(), and BuildHouseWindow::GetHouseInformation().

◆ minimum_life

uint8_t HouseSpec::minimum_life

The minimum number of years this house will survive before the town rebuilds it.

Definition at line 117 of file house.h.

Referenced by TileLoop_Town().

◆ population

uint8_t HouseSpec::population

population (Zero on other tiles in multi tile house.)

Definition at line 97 of file house.h.

Referenced by BuildTownHouse(), ClearTownHouse(), BuildHouseWindow::GetHouseInformation(), IsHouseSpecValid(), RebuildTownCaches(), and TileLoop_Town().

◆ probability

uint8_t HouseSpec::probability

Relative probability of appearing (16 is the standard value)

Definition at line 112 of file house.h.

Referenced by TryBuildTownHouse().

◆ processing_time

uint8_t HouseSpec::processing_time

Periodic refresh multiplier.

Definition at line 116 of file house.h.

◆ random_colour

Colours HouseSpec::random_colour[4]

4 "random" colours

Definition at line 111 of file house.h.

Referenced by DrawNewHouseTileInGUI().

◆ removal_cost

uint8_t HouseSpec::removal_cost

cost multiplier for removing it

Definition at line 98 of file house.h.

Referenced by GetRemovalCost().

◆ remove_rating_decrease

uint16_t HouseSpec::remove_rating_decrease

rating decrease if removed

Definition at line 100 of file house.h.

Referenced by ClearTile_Town().

◆ watched_cargoes

CargoTypes HouseSpec::watched_cargoes

Cargo types watched for acceptance.

Definition at line 118 of file house.h.

Referenced by WatchedCargoCallback().


The documentation for this struct was generated from the following files: