OpenTTD Source  14.0-beta3
newgrf_house.h File Reference
#include "newgrf_callbacks.h"
#include "tile_cmd.h"
#include "house_type.h"
#include "newgrf_spritegroup.h"
#include "newgrf_town.h"

Go to the source code of this file.

Data Structures

struct  HouseScopeResolver
 Scope resolver for houses. More...
 
struct  HouseResolverObject
 Resolver object to be used for houses (feature 07 spritegroups). More...
 
struct  HouseClassMapping
 Makes class IDs unique to each GRF file. More...
 

Enumerations

enum  HouseTrigger { HOUSE_TRIGGER_TILE_LOOP = 0x01, HOUSE_TRIGGER_TILE_LOOP_TOP = 0x02 }
 

Functions

void ResetHouseClassIDs ()
 
HouseClassID AllocateHouseClassID (byte grf_class_id, uint32_t grfid)
 
void InitializeBuildingCounts ()
 
void IncreaseBuildingCount (Town *t, HouseID house_id)
 IncreaseBuildingCount() Increase the count of a building when it has been added by a town. More...
 
void DecreaseBuildingCount (Town *t, HouseID house_id)
 DecreaseBuildingCount() Decrease the number of a building when it is deleted. More...
 
void DrawNewHouseTile (TileInfo *ti, HouseID house_id)
 
void AnimateNewHouseTile (TileIndex tile)
 
void AnimateNewHouseConstruction (TileIndex tile)
 
uint16_t GetHouseCallback (CallbackID callback, uint32_t param1, uint32_t param2, HouseID house_id, Town *town, TileIndex tile, bool not_yet_constructed=false, uint8_t initial_random_bits=0, CargoTypes watched_cargo_triggers=0)
 
void WatchedCargoCallback (TileIndex tile, CargoTypes trigger_cargoes)
 Run watched cargo accepted callback for a house. More...
 
bool CanDeleteHouse (TileIndex tile)
 
bool NewHouseTileLoop (TileIndex tile)
 
void TriggerHouse (TileIndex t, HouseTrigger trigger)
 

Detailed Description

Functions related to NewGRF houses.

Definition in file newgrf_house.h.

Function Documentation

◆ DecreaseBuildingCount()

void DecreaseBuildingCount ( Town t,
HouseID  house_id 
)

DecreaseBuildingCount() Decrease the number of a building when it is deleted.

Parameters
tThe town that the building was built in
house_idThe id of the house being removed

Definition at line 131 of file newgrf_house.cpp.

References TownCache::building_counts, Town::cache, and HouseSpec::class_id.

Referenced by DoClearTownHouseHelper().

◆ IncreaseBuildingCount()

void IncreaseBuildingCount ( Town t,
HouseID  house_id 
)

IncreaseBuildingCount() Increase the count of a building when it has been added by a town.

Parameters
tThe town that the building is being built in
house_idThe id of the house being added

Definition at line 112 of file newgrf_house.cpp.

References TownCache::building_counts, Town::cache, and HouseSpec::class_id.

Referenced by ClearMakeHouseTile().

◆ WatchedCargoCallback()

void WatchedCargoCallback ( TileIndex  tile,
CargoTypes  trigger_cargoes 
)

Run watched cargo accepted callback for a house.

Parameters
tileHouse tile.
trigger_cargoesTriggering cargo types.
Precondition
IsTileType(t, MP_HOUSE)

Definition at line 655 of file newgrf_house.cpp.

References GetHouseType(), IsTileType(), MP_HOUSE, and HouseSpec::watched_cargoes.

Referenced by TriggerWatchedCargoCallbacks().