47 uint32_t
GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter,
bool &available)
const override;
58 bool not_yet_constructed =
false, uint8_t initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0,
int view = 0);
91void ResetHouseClassIDs();
92HouseClassID AllocateHouseClassID(uint8_t grf_class_id, uint32_t grfid);
102void AnimateNewHouseConstruction(
TileIndex tile);
105 bool not_yet_constructed =
false, uint8_t initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0,
int view = 0);
114 HOUSE_TRIGGER_TILE_LOOP = 0x01,
119 HOUSE_TRIGGER_TILE_LOOP_TOP = 0x02,
121void TriggerHouse(
TileIndex t, HouseTrigger trigger);
declaration of basic house types and enums
uint16_t HouseClassID
Classes of houses.
uint16_t HouseID
OpenTTD ID of house types.
Callbacks that NewGRFs could implement.
CallbackID
List of implemented NewGRF callbacks.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
void DecreaseBuildingCount(Town *t, HouseID house_id)
DecreaseBuildingCount() Decrease the number of a building when it is deleted.
void IncreaseBuildingCount(Town *t, HouseID house_id)
IncreaseBuildingCount() Increase the count of a building when it has been added by a town.
void WatchedCargoCallback(TileIndex tile, CargoTypes trigger_cargoes)
Run watched cargo accepted callback for a house.
std::span< const uint > GetBuildingHouseIDCounts()
Get read-only span of total HouseID building counts.
void InitializeBuildingCounts()
Initialise global building counts and all town building counts.
@ VSG_SCOPE_SELF
Resolved object itself.
@ VSG_SCOPE_PARENT
Related object of the resolved one.
Functions to handle the town part of NewGRF towns.
Makes class IDs unique to each GRF file.
uint8_t class_id
The class id within the grf file.
uint32_t grfid
The GRF ID of the file this class belongs to.
Resolver object to be used for houses (feature 07 spritegroups).
uint32_t GetDebugID() const override
Get an identifier for the item being resolved.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
Scope resolver for houses.
int view
View when house does yet exist.
Town * town
Town of this house.
TileIndex tile
Tile of this house.
CargoTypes watched_cargo_triggers
Cargo types that triggered the watched cargo callback.
uint32_t GetVariable(uint8_t variable, uint32_t parameter, bool &available) const override
HouseScopeResolver(ResolverObject &ro, HouseID house_id, TileIndex tile, Town *town, bool not_yet_constructed, uint8_t initial_random_bits, CargoTypes watched_cargo_triggers, int view)
Constructor of a house scope resolver.
uint16_t initial_random_bits
Random bits during construction checks.
uint32_t GetRandomBits() const override
Get a few random bits.
HouseID house_id
Type of house being queried.
uint32_t GetTriggers() const override
Get the triggers.
bool not_yet_constructed
True for construction check.
Interface for SpriteGroup-s to access the gamestate.
CallbackID callback
Callback being resolved.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0)
Get a resolver for the scope.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
ResolverObject & ro
Surrounding resolver object.
Tile information, used while rendering the tile.
Scope resolver for a town.
Generic 'commands' that can be performed on all tiles.