OpenTTD
Public Member Functions
HouseOverrideManager Class Reference
Inheritance diagram for HouseOverrideManager:
OverrideManagerBase

Public Member Functions

 HouseOverrideManager (uint16 offset, uint16 maximum, uint16 invalid)
void SetEntitySpec (const HouseSpec *hs)
 Install the specs into the HouseSpecs array It will find itself the proper slot on which it will go.
- Public Member Functions inherited from OverrideManagerBase
 OverrideManagerBase (uint16 offset, uint16 maximum, uint16 invalid)
 Constructor of generic class.
virtual ~OverrideManagerBase ()
 Destructor of the generic class.
void ResetOverride ()
 Resets the override, which is used while initializing game.
void ResetMapping ()
 Resets the mapping, which is used while initializing game.
void Add (uint8 local_id, uint32 grfid, uint entity_type)
 Since the entity IDs defined by the GRF file does not necessarily correlate to those used by the game, the IDs used for overriding old entities must be translated when the entity spec is set.
virtual uint16 AddEntityID (byte grf_local_id, uint32 grfid, byte substitute_id)
 Reserves a place in the mapping array for an entity to be installed.
uint32 GetGRFID (uint16 entity_id) const
 Gives the GRFID of the file the entity belongs to.
uint16 GetSubstituteID (uint16 entity_id) const
 Gives the substitute of the entity, as specified by the grf file.
virtual uint16 GetID (uint8 grf_local_id, uint32 grfid) const
 Return the ID (if ever available) of a previously inserted entity.
uint16 GetMaxMapping () const
uint16 GetMaxOffset () const

Additional Inherited Members

- Data Fields inherited from OverrideManagerBase
EntityIDMappingmapping_ID
 mapping of ids from grf files. Public out of convenience
- Protected Member Functions inherited from OverrideManagerBase
virtual bool CheckValidNewID (uint16 testid)
- Protected Attributes inherited from OverrideManagerBase
uint16 * entity_overrides
uint32 * grfid_overrides
uint16 max_offset
 what is the length of the original entity's array of specs
uint16 max_new_entities
 what is the amount of entities, old and new summed
uint16 invalid_ID
 ID used to detected invalid entities;.

Detailed Description

Definition at line 227 of file newgrf_commons.h.

Member Function Documentation

void HouseOverrideManager::SetEntitySpec ( const HouseSpec hs)

Install the specs into the HouseSpecs array It will find itself the proper slot on which it will go.

Parameters
hsHouseSpec read from the grf file, ready for inclusion

Definition at line 178 of file newgrf_commons.cpp.

References OverrideManagerBase::AddEntityID(), HouseSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, grfmsg(), OverrideManagerBase::invalid_ID, GRFFilePropsBase< Tcnt >::local_id, OverrideManagerBase::max_offset, MemCpyT(), and GRFFileProps::override.

Referenced by FinaliseHouseArray().


The documentation for this class was generated from the following files: