OpenTTD Source  20241120-master-g6d3adc6169
HouseSpec Struct Reference

Public Member Functions

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

Static Public Member Functions

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

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.

◆ Index()

HouseID HouseSpec::Index ( ) const

Gets the index of this spec.

Returns
The index.

Definition at line 59 of file newgrf_house.cpp.

◆ Specs()

std::vector< HouseSpec > & HouseSpec::Specs ( )
static

Get a reference to all HouseSpecs.

Returns
Reference to vector of all HouseSpecs.

Definition at line 50 of file newgrf_house.cpp.

Referenced by EnsureEarlyHouse(), HousePickerCallbacks::GetTypeCount(), InitializeBuildingCounts(), and HousePickerCallbacks::UpdateSavedItems().


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