maedhros@6332: /* $Id$ */ maedhros@6332: maedhros@6332: /** @file newgrf_house.h */ maedhros@6332: maedhros@6332: #ifndef NEWGRF_HOUSE_H maedhros@6332: #define NEWGRF_HOUSE_H maedhros@6332: maedhros@6332: #include "town.h" rubidium@7327: #include "newgrf_callbacks.h" maedhros@6332: maedhros@6332: /** maedhros@6332: * Makes class IDs unique to each GRF file. maedhros@6332: * Houses can be assigned class IDs which are only comparable within the GRF maedhros@6332: * file they were defined in. This mapping ensures that if two houses have the maedhros@6332: * same class as defined by the GRF file, the classes are different within the maedhros@6332: * game. An array of HouseClassMapping structs is created, and the array index maedhros@6332: * of the struct that matches both the GRF ID and the class ID is the class ID maedhros@6332: * used in the game. maedhros@6332: * maedhros@6332: * Although similar to the HouseIDMapping struct above, this serves a different maedhros@6332: * purpose. Since the class ID is not saved anywhere, this mapping does not maedhros@6332: * need to be persistent; it just needs to keep class ids unique. maedhros@6332: */ maedhros@6332: struct HouseClassMapping { maedhros@6332: uint32 grfid; ////< The GRF ID of the file this class belongs to maedhros@6332: uint8 class_id; ////< The class id within the grf file maedhros@6332: }; maedhros@6332: maedhros@6332: void CheckHouseIDs(); maedhros@6332: maedhros@6332: HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid); maedhros@6332: maedhros@6332: void InitializeBuildingCounts(); maedhros@6332: void IncreaseBuildingCount(Town *t, HouseID house_id); maedhros@6332: void DecreaseBuildingCount(Town *t, HouseID house_id); maedhros@6332: void AfterLoadCountBuildings(); maedhros@6332: maedhros@6332: void DrawNewHouseTile(TileInfo *ti, HouseID house_id); maedhros@6332: void AnimateNewHouseTile(TileIndex tile); maedhros@6332: void ChangeHouseAnimationFrame(TileIndex tile, uint16 callback_result); maedhros@6332: rubidium@7327: uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, Town *town, TileIndex tile); maedhros@6332: maedhros@6332: bool CanDeleteHouse(TileIndex tile); maedhros@6332: maedhros@6332: bool NewHouseTileLoop(TileIndex tile); maedhros@6332: maedhros@6332: #endif /* NEWGRF_HOUSE_H */