OpenTTD Source 20250205-master-gfd85ab1e2c
|
definition of HouseSpec and accessors More...
#include "cargo_type.h"
#include "timer/timer_game_calendar.h"
#include "house_type.h"
#include "newgrf_animation_type.h"
#include "newgrf_callbacks.h"
#include "newgrf_commons.h"
Go to the source code of this file.
Data Structures | |
struct | HouseSpec |
Typedefs | |
using | BuildingFlags = EnumBitSet< BuildingFlag, uint8_t > |
using | HouseExtraFlags = EnumBitSet< HouseExtraFlag, uint8_t > |
Enumerations | |
enum class | BuildingFlag : uint8_t { Size1x1 = 0 , NotSloped = 1 , Size2x1 = 2 , Size1x2 = 3 , Size2x2 = 4 , IsAnimated = 5 , IsChurch = 6 , IsStadium = 7 } |
enum | HouseZonesBits : uint8_t { HZB_BEGIN = 0 , HZB_TOWN_EDGE = 0 , HZB_TOWN_OUTSKIRT , HZB_TOWN_OUTER_SUBURB , HZB_TOWN_INNER_SUBURB , HZB_TOWN_CENTRE , HZB_END } |
enum | HouseZones : uint16_t { HZ_NOZNS = 0x0000 , HZ_ZON1 = 1U << HZB_TOWN_EDGE , HZ_ZON2 = 1U << HZB_TOWN_OUTSKIRT , HZ_ZON3 = 1U << HZB_TOWN_OUTER_SUBURB , HZ_ZON4 = 1U << HZB_TOWN_INNER_SUBURB , HZ_ZON5 = 1U << HZB_TOWN_CENTRE , HZ_ZONALL = 0x001F , HZ_SUBARTC_ABOVE = 0x0800 , HZ_TEMP = 0x1000 , HZ_SUBARTC_BELOW = 0x2000 , HZ_SUBTROPIC = 0x4000 , HZ_TOYLND = 0x8000 , HZ_CLIMALL = 0xF800 } |
enum class | HouseExtraFlag : uint8_t { BuildingIsHistorical = 0 , BuildingIsProtected = 1 , SynchronisedCallback1B = 2 , Callback1ARandomBits = 3 } |
Functions | |
HouseID | GetTranslatedHouseID (HouseID hid) |
Do HouseID translation for NewGRFs. | |
void | ShowBuildHousePicker (struct Window *) |
Variables | |
static const uint8_t | TOWN_HOUSE_COMPLETED = 3 |
Simple value that indicates the house has reached the final stage of construction. | |
static const uint | HOUSE_NO_CLASS = 0 |
static const HouseID | NEW_HOUSE_OFFSET = 110 |
Offset for new houses. | |
static const HouseID | NUM_HOUSES = 4096 |
Total number of houses. | |
static const HouseID | INVALID_HOUSE_ID = UINT16_MAX |
static const HouseID | NUM_HOUSES_PER_GRF = NUM_HOUSES |
Number of supported houses per NewGRF. | |
static const uint | HOUSE_NUM_ACCEPTS = 16 |
Max number of cargoes accepted by a tile. | |
static const uint | HOUSE_ORIGINAL_NUM_ACCEPTS = 3 |
Original number of accepted cargo types. | |
static constexpr BuildingFlags | BUILDING_HAS_1_TILE = {BuildingFlag::Size1x1, BuildingFlag::Size2x1, BuildingFlag::Size1x2, BuildingFlag::Size2x2} |
static constexpr BuildingFlags | BUILDING_HAS_2_TILES = {BuildingFlag::Size2x1, BuildingFlag::Size1x2, BuildingFlag::Size2x2} |
static constexpr BuildingFlags | BUILDING_2_TILES_X = {BuildingFlag::Size2x1, BuildingFlag::Size2x2} |
static constexpr BuildingFlags | BUILDING_2_TILES_Y = {BuildingFlag::Size1x2, BuildingFlag::Size2x2} |
static constexpr BuildingFlags | BUILDING_HAS_4_TILES = {BuildingFlag::Size2x2} |
using BuildingFlags = EnumBitSet<BuildingFlag, uint8_t> |
using HouseExtraFlags = EnumBitSet<HouseExtraFlag, uint8_t> |
|
strong |
Enumerator | |
---|---|
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 |
SynchronisedCallback1B | synchronized callback 1B will be performed, on multi tile houses |
Callback1ARandomBits | callback 1A needs random bits |
enum HouseZones : uint16_t |
Do HouseID translation for NewGRFs.
hid | the HouseID to get the override for. |
Definition at line 133 of file house.h.
References HouseSpec::Get(), HouseSpec::grf_prop, and GRFFileProps::override.
Referenced by GetHouseType().
void ShowBuildHousePicker | ( | struct Window * | parent | ) |
Definition at line 1787 of file town_gui.cpp.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |
|
static |
Original number of accepted cargo types.
Definition at line 34 of file house.h.
Referenced by TownHouseChangeInfo().
|
static |
Offset for new houses.
Definition at line 27 of file house.h.
Referenced by AfterLoadGame(), AnimateTile_Town(), DrawHouseInGUI(), DrawTile_Town(), GetFoundation_Town(), HouseScopeResolver::GetVariable(), TileLoop_Town(), TownHouseChangeInfo(), and UpdateHousesAndTowns().
|
static |
Total number of houses.
Definition at line 28 of file house.h.
Referenced by FinaliseHouseArray(), and HouseSpec::Get().
|
static |
Number of supported houses per NewGRF.
Definition at line 31 of file house.h.
Referenced by TownHouseChangeInfo().
|
static |
Simple value that indicates the house has reached the final stage of construction.
Definition at line 24 of file house.h.
Referenced by AfterLoadGame(), BuildTownHouse(), DrawHouseInGUI(), DrawNewHouseTileInGUI(), GetHouseBuildingStage(), HouseScopeResolver::GetVariable(), IncHouseConstructionTick(), and MakeHouseTile().