26static const uint HOUSE_NO_CLASS = 0;
29static const HouseID INVALID_HOUSE_ID = UINT16_MAX;
36enum class BuildingFlag : uint8_t {
48static constexpr BuildingFlags BUILDING_HAS_1_TILE = {BuildingFlag::Size1x1, BuildingFlag::Size2x1, BuildingFlag::Size1x2, BuildingFlag::Size2x2};
49static constexpr BuildingFlags BUILDING_HAS_2_TILES = {BuildingFlag::Size2x1, BuildingFlag::Size1x2, BuildingFlag::Size2x2};
50static constexpr BuildingFlags BUILDING_2_TILES_X = {BuildingFlag::Size2x1, BuildingFlag::Size2x2};
51static constexpr BuildingFlags BUILDING_2_TILES_Y = {BuildingFlag::Size1x2, BuildingFlag::Size2x2};
52static constexpr BuildingFlags BUILDING_HAS_4_TILES = {BuildingFlag::Size2x2};
54enum HouseZonesBits : uint8_t {
58 HZB_TOWN_OUTER_SUBURB,
59 HZB_TOWN_INNER_SUBURB,
63static_assert(HZB_END == 5);
70 HZ_ZON2 = 1U << HZB_TOWN_OUTSKIRT,
71 HZ_ZON3 = 1U << HZB_TOWN_OUTER_SUBURB,
72 HZ_ZON4 = 1U << HZB_TOWN_INNER_SUBURB,
124 static std::vector<HouseSpec> &
Specs();
139void ShowBuildHousePicker(
struct Window *);
Types related to cargoes...
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
#define DECLARE_ENUM_AS_BIT_SET(enum_type)
Operators to allow to work with enum as with type safe bit set in C++.
#define DECLARE_INCREMENT_DECREMENT_OPERATORS(enum_type)
For some enums it is useful to have pre/post increment/decrement operators.
@ 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
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.
@ HZ_SUBARTC_BELOW
13 2000 can appear in sub-arctic climate below the snow line
@ HZ_ZONALL
1F This is just to englobe all above types at once
@ HZ_CLIMALL
Bitmask of all climate bits.
@ HZ_TEMP
12 1000 can appear in temperate climate
@ HZ_TOYLND
15 8000 can appear in toyland climate
@ HZ_SUBTROPIC
14 4000 can appear in subtropical climate
@ HZ_SUBARTC_ABOVE
11 800 can appear in sub-arctic climate above the snow line
@ HZ_ZON1
0..4 1,2,4,8,10 which town zones the building can be built in, Zone1 been the further suburb
@ HZ_NOZNS
0 This is just to get rid of zeros, meaning none
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.
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.
Data related to the handling of grf files.
uint16_t override
id of the entity been replaced by
CargoType accepts_cargo[HOUSE_NUM_ACCEPTS]
input cargo slots
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...)
AnimationInfo animation
information about the animation.
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)
StringID building_name
building name
uint8_t minimum_life
The minimum number of years this house will survive before the town rebuilds it.
GRFFileProps grf_prop
Properties related the the grf file.
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.
Data structure for an opened window.
Definition of the game-calendar-timer.