27static const uint HOUSE_NO_CLASS = 0;
30static const HouseID INVALID_HOUSE_ID = UINT16_MAX;
73static constexpr uint NUM_HOUSE_ZONES =
to_underlying(HouseZone::TownEnd);
74static_assert(NUM_HOUSE_ZONES == 5);
126 std::vector<BadgeID> badges;
133 static std::vector<HouseSpec> &
Specs();
148void ShowBuildHousePicker(
struct Window *);
Types related to cargoes...
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
constexpr std::underlying_type_t< enum_type > to_underlying(enum_type e)
Implementation of std::to_underlying (from C++23)
@ SynchronisedCallback1B
synchronized callback 1B will be performed, on multi tile houses
@ Callback1ARandomBits
callback 1A needs random bits
@ BuildingIsHistorical
this house will only appear during town generation in random games, thus the historical
@ BuildingIsProtected
towns and AI will not remove this house, while human players will be able to
HouseZones GetClimateMaskForLandscape()
Get the HouseZones climate mask for the current landscape type.
static const HouseID NUM_HOUSES
Total number of houses.
BuildingFlag
Flags describing the layout and purpose of a building.
@ Size1x1
The building is a single tile.
@ Size2x2
The building is 2x2 tiles.
@ IsAnimated
The building uses animation.
@ NotSloped
The building can only be built on flat land; when not set foundations are placed.
@ Size2x1
The building is 2x1 tiles, i.e. wider on the X-axis.
@ IsChurch
The building functions as a church, i.e. only one can be built in a town.
@ IsStadium
The building functions as a stadium, i.e. only one can be built in a town.
@ Size1x2
The building is 1x2 tiles, i.e. wider on the Y-axis.
static const HouseID NEW_HOUSE_OFFSET
Offset for new houses.
HouseID GetTranslatedHouseID(HouseID hid)
Do HouseID translation for NewGRFs.
static const HouseID NUM_HOUSES_PER_GRF
Number of supported houses per NewGRF.
static const uint HOUSE_NUM_ACCEPTS
Max number of cargoes accepted by a tile.
static const uint8_t TOWN_HOUSE_COMPLETED
Simple value that indicates the house has reached the final stage of construction.
static const uint HOUSE_ORIGINAL_NUM_ACCEPTS
Original number of accepted cargo types.
HouseZone
Concentric rings of zoning around the centre of a town.
@ TownOuterSuburb
Outer suburbs; roads with pavement.
@ ClimateSubarcticAboveSnow
Building can appear in sub-arctic climate above the snow line.
@ ClimateSubarcticBelowSnow
Building can appear in sub-arctic climate below the snow line.
@ TownInnerSuburb
Inner suburbs; roads with pavement and trees.
@ TownOutskirt
Outskirts of a town; roads without pavement.
@ TownEdge
Edge of the town; roads without pavement.
@ TownCentre
Centre of town; roads with pavement and streetlights.
@ ClimateTemperate
Building can appear in temperate climate.
@ ClimateToyland
Building can appear in toyland climate.
@ ClimateSubtropic
Building can appear in subtropical climate.
Declaration of basic house types and enums.
uint16_t HouseClassID
Classes of houses.
uint16_t HouseID
OpenTTD ID of house types.
Definitions related to NewGRF animation.
Types related to NewGRF badges.
Callbacks that NewGRFs could implement.
This file simplifies and embeds a common mechanism of loading/saving and mapping of grf entities.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Information about animation.
CargoType accepts_cargo[HOUSE_NUM_ACCEPTS]
input cargo slots
SubstituteGRFFileProps grf_prop
Properties related the the grf file.
uint8_t probability
Relative probability of appearing (16 is the standard value)
CargoTypes watched_cargoes
Cargo types watched for acceptance.
uint8_t removal_cost
cost multiplier for removing it
uint8_t mail_generation
mail generation multiplier (tile based, as the acceptances below)
bool enabled
the house is available to build (true by default, but can be disabled by newgrf)
CargoLabel accepts_cargo_label[HOUSE_ORIGINAL_NUM_ACCEPTS]
input landscape cargo slots
Money GetRemovalCost() const
Get the cost for removing this house.
static HouseSpec * Get(size_t house_id)
Get the spec for a house ID.
BuildingFlags building_flags
some flags that describe the house (size, stadium etc...)
TimerGameCalendar::Year max_year
last year it can be built
uint8_t processing_time
Periodic refresh multiplier.
HouseCallbackMasks callback_mask
Bitmask of house callbacks that have to be called.
uint16_t remove_rating_decrease
rating decrease if removed
uint8_t population
population (Zero on other tiles in multi tile house.)
HouseExtraFlags extra_flags
some more flags
uint8_t cargo_acceptance[HOUSE_NUM_ACCEPTS]
acceptance level for the cargo slots
TimerGameCalendar::Year min_year
introduction year of the house
HouseID Index() const
Gets the index of this spec.
HouseClassID class_id
defines the class this house has (not grf file based)
AnimationInfo< void > animation
information about the animation.
StringID building_name
building name
uint8_t minimum_life
The minimum number of years this house will survive before the town rebuilds it.
Colours random_colour[4]
4 "random" colours
HouseZones building_availability
where can it be built (climates, zones)
static std::vector< HouseSpec > & Specs()
Get a reference to all HouseSpecs.
Templated helper to make a type-safe 'typedef' representing a single POD value.
NewGRF entities which can replace default entities.
uint16_t override_id
id of the entity been replaced by
Data structure for an opened window.
Definition of the game-calendar-timer.