10 #ifndef NEWGRF_HOUSE_H 11 #define NEWGRF_HOUSE_H 39 bool not_yet_constructed, uint8 initial_random_bits, CargoTypes watched_cargo_triggers)
40 :
ScopeResolver(ro), house_id(house_id), tile(tile), town(town), not_yet_constructed(not_yet_constructed),
41 initial_random_bits(initial_random_bits), watched_cargo_triggers(watched_cargo_triggers)
46 uint32
GetVariable(byte variable, uint32 parameter,
bool *available)
const override;
87 HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid);
89 void InitializeBuildingCounts();
107 HOUSE_TRIGGER_TILE_LOOP = 0x01,
112 HOUSE_TRIGGER_TILE_LOOP_TOP = 0x02,
114 void TriggerHouse(
TileIndex t, HouseTrigger trigger);
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope)...
Tile information, used while rendering the tile.
ResolverObject & ro
Surrounding resolver object.
void WatchedCargoCallback(TileIndex tile, CargoTypes trigger_cargoes)
Run watched cargo accepted callback for a house.
Interface for SpriteGroup-s to access the gamestate.
declaration of basic house types and enums
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override
Town * town
Town of this house.
uint16 HouseClassID
Classes of houses.
Makes class IDs unique to each GRF file.
Set when using the callback resolve system, but not to resolve a callback.
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.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
Resolver object to be used for houses (feature 07 spritegroups).
uint16 initial_random_bits
Random bits during construction checks.
uint16 HouseID
OpenTTD ID of house types.
Callbacks that NewGRFs could implement.
CargoTypes watched_cargo_triggers
Cargo types that triggered the watched cargo callback.
HouseID house_id
Type of house being queried.
Scope resolver for houses.
Scope resolver for a town.
bool not_yet_constructed
True for construction check.
void DecreaseBuildingCount(Town *t, HouseID house_id)
DecreaseBuildingCount() Decrease the number of a building when it is deleted.
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...
TileIndex tile
Tile of this house.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
uint32 GetRandomBits() const override
Get a few random bits.
uint32 TileIndex
The index/ID of a Tile.
Related object of the resolved one.
uint32 GetTriggers() const override
Get the triggers.
CallbackID
List of implemented NewGRF callbacks.
Functions to handle the town part of NewGRF towns.
uint32 grfid
The GRF ID of the file this class belongs to.
Generic 'commands' that can be performed on all tiles.