Go to the documentation of this file.
10 #ifndef NEWGRF_HOUSE_H
11 #define NEWGRF_HOUSE_H
46 uint32
GetVariable(
byte variable, uint32 parameter,
bool *available)
const override;
57 bool not_yet_constructed =
false, uint8 initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0);
90 HouseClassID AllocateHouseClassID(
byte grf_class_id, uint32 grfid);
92 void InitializeBuildingCounts();
98 void AnimateNewHouseConstruction(
TileIndex tile);
101 bool not_yet_constructed =
false, uint8 initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0);
110 HOUSE_TRIGGER_TILE_LOOP = 0x01,
115 HOUSE_TRIGGER_TILE_LOOP_TOP = 0x02,
117 void TriggerHouse(
TileIndex t, HouseTrigger trigger);
uint32 GetDebugID() const override
Get an identifier for the item being resolved.
uint32 TileIndex
The index/ID of a Tile.
uint32 GetTriggers() const override
Get the triggers.
Town * town
Town of this house.
CargoTypes watched_cargo_triggers
Cargo types that triggered the watched cargo callback.
Tile information, used while rendering the tile.
Resolver object to be used for houses (feature 07 spritegroups).
Interface for SpriteGroup-s to access the gamestate.
CallbackID
List of implemented NewGRF callbacks.
@ VSG_SCOPE_PARENT
Related object of the resolved one.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
void WatchedCargoCallback(TileIndex tile, CargoTypes trigger_cargoes)
Run watched cargo accepted callback for a house.
uint32 grfid
The GRF ID of the file this class belongs to.
uint32 GetRandomBits() const override
Get a few random bits.
@ VSG_SCOPE_SELF
Resolved object itself.
HouseID house_id
Type of house being queried.
bool not_yet_constructed
True for construction check.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
uint8 class_id
The class id within the grf file.
void IncreaseBuildingCount(Town *t, HouseID house_id)
IncreaseBuildingCount() Increase the count of a building when it has been added by a town.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
Scope resolver for a town.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
void DecreaseBuildingCount(Town *t, HouseID house_id)
DecreaseBuildingCount() Decrease the number of a building when it is deleted.
HouseScopeResolver(ResolverObject &ro, HouseID house_id, TileIndex tile, Town *town, bool not_yet_constructed, uint8 initial_random_bits, CargoTypes watched_cargo_triggers)
Constructor of a house scope resolver.
uint16 HouseID
OpenTTD ID of house types.
uint16 initial_random_bits
Random bits during construction checks.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
CallbackID callback
Callback being resolved.
Scope resolver for houses.
HouseResolverObject(HouseID house_id, TileIndex tile, Town *town, CallbackID callback=CBID_NO_CALLBACK, uint32 param1=0, uint32 param2=0, bool not_yet_constructed=false, uint8 initial_random_bits=0, CargoTypes watched_cargo_triggers=0)
Construct a resolver for a house.
uint16 HouseClassID
Classes of houses.
TileIndex tile
Tile of this house.
ResolverObject & ro
Surrounding resolver object.
Makes class IDs unique to each GRF file.