|
OpenTTD Source 20260820-master-g39da062c0c
|
Public Member Functions | |
| IndustryOverrideManager (uint16_t offset, uint16_t maximum, uint16_t invalid) | |
| uint16_t | AddEntityID (uint16_t grf_local_id, GrfID grfid, uint16_t substitute_id) override |
| Method to find an entity ID and to mark it as reserved for the Industry to be included. | |
| uint16_t | GetID (uint16_t grf_local_id, GrfID grfid) const override |
| Return the ID (if ever available) of a previously inserted entity. | |
| void | SetEntitySpec (IndustrySpec &&inds) |
| Method to install the new industry data in its proper slot The slot assignment is internal of this method, since it requires checking what is available. | |
| Public Member Functions inherited from OverrideManagerBase | |
| OverrideManagerBase (uint16_t offset, uint16_t maximum, uint16_t invalid) | |
| Constructor of generic class. | |
| virtual | ~OverrideManagerBase ()=default |
| Ensure the destructor of the sub classes are called as well. | |
| void | ResetOverride () |
| Resets the override, which is used while initializing game. | |
| void | ResetMapping () |
| Resets the mapping, which is used while initializing game. | |
| void | Add (uint16_t local_id, GrfID 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. | |
| GrfID | GetGRFID (uint16_t entity_id) const |
| Gives the GRFID of the file the entity belongs to. | |
| uint16_t | GetSubstituteID (uint16_t entity_id) const |
| Gives the substitute of the entity, as specified by the grf file. | |
| uint16_t | GetMaxMapping () const |
| uint16_t | GetMaxOffset () const |
Additional Inherited Members | |
| Data Fields inherited from OverrideManagerBase | |
| std::vector< EntityIDMapping > | mappings |
| mapping of ids from grf files. Public out of convenience | |
| Protected Attributes inherited from OverrideManagerBase | |
| std::vector< uint16_t > | entity_overrides |
| std::vector< GrfID > | grfid_overrides |
| const uint16_t | max_offset |
| what is the length of the original entity's array of specs | |
| const uint16_t | max_entities |
| what is the amount of entities, old and new summed | |
| const uint16_t | invalid_id |
| ID used to detected invalid entities. | |
Definition at line 242 of file newgrf_commons.h.
|
inline |
Definition at line 244 of file newgrf_commons.h.
|
overridevirtual |
Method to find an entity ID and to mark it as reserved for the Industry to be included.
| grf_local_id | ID used by the grf file for pre-installation work (equivalent of TTDPatch's setid |
| grfid | ID of the current grf file |
| substitute_id | industry from which data has been copied |
Reimplemented from OverrideManagerBase.
Definition at line 207 of file newgrf_commons.cpp.
References BaseLabel::Empty(), IndustrySpec::enabled, EntityIDMapping::entity_id, GetIndustrySpec(), IndustrySpec::grf_prop, EntityIDMapping::grfid, GRFFilePropsBase::HasGrfFile(), OverrideManagerBase::invalid_id, OverrideManagerBase::mappings, OverrideManagerBase::max_entities, OverrideManagerBase::max_offset, and EntityIDMapping::substitute_id.
Referenced by SetEntitySpec().
|
overridevirtual |
Return the ID (if ever available) of a previously inserted entity.
| grf_local_id | ID of this entity within the grfID |
| grfid | ID of the grf file |
Reimplemented from OverrideManagerBase.
Definition at line 187 of file newgrf_commons.cpp.
References OverrideManagerBase::GetID(), OverrideManagerBase::invalid_id, and OverrideManagerBase::max_offset.
Referenced by SetEntitySpec().
| void IndustryOverrideManager::SetEntitySpec | ( | IndustrySpec && | inds | ) |
Method to install the new industry data in its proper slot The slot assignment is internal of this method, since it requires checking what is available.
| inds | Industryspec that comes from the grf decoding process |
Definition at line 242 of file newgrf_commons.cpp.
References AddEntityID(), GetID(), and OverrideManagerBase::invalid_id.