27 static const uint HOUSE_NO_CLASS = 0;
30 static const HouseID INVALID_HOUSE_ID = 0xFFFF;
35 enum BuildingFlags : uint8_t {
37 TILE_SIZE_1x1 = 1U << 0,
38 TILE_NOT_SLOPED = 1U << 1,
39 TILE_SIZE_2x1 = 1U << 2,
40 TILE_SIZE_1x2 = 1U << 3,
41 TILE_SIZE_2x2 = 1U << 4,
42 BUILDING_IS_ANIMATED = 1U << 5,
43 BUILDING_IS_CHURCH = 1U << 6,
44 BUILDING_IS_STADIUM = 1U << 7,
45 BUILDING_HAS_1_TILE = TILE_SIZE_1x1 | TILE_SIZE_2x1 | TILE_SIZE_1x2 | TILE_SIZE_2x2,
46 BUILDING_HAS_2_TILES = TILE_SIZE_2x1 | TILE_SIZE_1x2 | TILE_SIZE_2x2,
47 BUILDING_2_TILES_X = TILE_SIZE_2x1 | TILE_SIZE_2x2,
48 BUILDING_2_TILES_Y = TILE_SIZE_1x2 | TILE_SIZE_2x2,
49 BUILDING_HAS_4_TILES = TILE_SIZE_2x2,
53 enum HouseZonesBits : uint8_t {
57 HZB_TOWN_OUTER_SUBURB,
58 HZB_TOWN_INNER_SUBURB,
62 static_assert(HZB_END == 5);
69 HZ_ZON2 = 1U << HZB_TOWN_OUTSKIRT,
70 HZ_ZON3 = 1U << HZB_TOWN_OUTER_SUBURB,
71 HZ_ZON4 = 1U << HZB_TOWN_INNER_SUBURB,
100 uint16_t remove_rating_decrease;
111 uint16_t callback_mask;
112 Colours random_colour[4];
122 Money GetRemovalCost()
const;
124 static std::vector<HouseSpec> &Specs();
139 void ShowBuildHousePicker(
struct Window *);
Types related to cargoes...
uint8_t CargoID
Cargo slots to indicate a cargo type within a game.
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
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; limited to 255 to allow extending Action3 with an extended byt...
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
@ BUILDING_IS_HISTORICAL
this house will only appear during town generation in random games, thus the historical
@ BUILDING_IS_PROTECTED
towns and AI will not remove this house, while human players will be able to
@ SYNCHRONISED_CALLBACK_1B
synchronized callback 1B will be performed, on multi tile houses
@ CALLBACK_1A_RANDOM_BITS
callback 1A needs random bits
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.
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
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)
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.
uint8_t population
population (Zero on other tiles in multi tile house.)
HouseExtraFlags extra_flags
some more flags
TimerGameCalendar::Year min_year
introduction year of the house
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.
HouseZones building_availability
where can it be built (climates, zones)
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.