12 #ifndef NEWGRF_HOUSE_H 13 #define NEWGRF_HOUSE_H 41 bool not_yet_constructed, uint8 initial_random_bits, uint32 watched_cargo_triggers)
42 :
ScopeResolver(ro), house_id(house_id), tile(tile), town(town), not_yet_constructed(not_yet_constructed),
43 initial_random_bits(initial_random_bits), watched_cargo_triggers(watched_cargo_triggers)
48 uint32
GetVariable(byte variable, uint32 parameter,
bool *available)
const;
89 HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid);
91 void InitializeBuildingCounts();
109 HOUSE_TRIGGER_TILE_LOOP = 0x01,
114 HOUSE_TRIGGER_TILE_LOOP_TOP = 0x02,
116 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.
Interface for SpriteGroup-s to access the gamestate.
declaration of basic house types and enums
Town * town
Town of this house.
uint16 HouseClassID
Classes of houses.
Makes class IDs unique to each GRF file.
uint32 GetRandomBits() const
Get a few random bits.
Set when using the callback resolve system, but not to resolve a callback.
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.
HouseID house_id
Type of house being queried.
HouseScopeResolver(ResolverObject &ro, HouseID house_id, TileIndex tile, Town *town, bool not_yet_constructed, uint8 initial_random_bits, uint32 watched_cargo_triggers)
Constructor of a house scope resolver.
Scope resolver for houses.
Scope resolver for a town.
uint32 watched_cargo_triggers
Cargo types that triggered the watched cargo callback.
uint32 GetTriggers() const
Get the triggers.
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)
Get a resolver for the scope.
void WatchedCargoCallback(TileIndex tile, uint32 trigger_cargoes)
Run watched cargo accepted callback for a house.
uint32 TileIndex
The index/ID of a Tile.
Related object of the resolved one.
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.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Generic 'commands' that can be performed on all tiles.