27static const uint HOUSE_NO_CLASS = 0;
30static const HouseID INVALID_HOUSE_ID = UINT16_MAX;
37enum class BuildingFlag : uint8_t {
49static constexpr BuildingFlags BUILDING_HAS_1_TILE = {BuildingFlag::Size1x1, BuildingFlag::Size2x1, BuildingFlag::Size1x2, BuildingFlag::Size2x2};
50static constexpr BuildingFlags BUILDING_HAS_2_TILES = {BuildingFlag::Size2x1, BuildingFlag::Size1x2, BuildingFlag::Size2x2};
51static constexpr BuildingFlags BUILDING_2_TILES_X = {BuildingFlag::Size2x1, BuildingFlag::Size2x2};
52static constexpr BuildingFlags BUILDING_2_TILES_Y = {BuildingFlag::Size1x2, BuildingFlag::Size2x2};
53static constexpr BuildingFlags BUILDING_HAS_4_TILES = {BuildingFlag::Size2x2};
71static constexpr uint NUM_HOUSE_ZONES =
to_underlying(HouseZone::TownEnd);
72static_assert(NUM_HOUSE_ZONES == 5);
76 HouseZone::TownOutskirt,
77 HouseZone::TownOuterSuburb,
78 HouseZone::TownInnerSuburb,
79 HouseZone::TownCentre,
124 std::vector<BadgeID> badges;
131 static std::vector<HouseSpec> &
Specs();
146void 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.
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.
@ ClimateSubarcticAboveSnow
Building can appear in sub-arctic climate above the snow line.
@ ClimateSubarcticBelowSnow
Building can appear in sub-arctic climate below the snow line.
@ 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 simplyfies 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.