App::cPropManager class

The implementation of IPropManager; this should only be used for extending and detouring.

Base classes

class IPropManager
A manager that stores all the property lists in the game, used for most configurations.
class Resource::IResourceFactory
An interface that can be used to create resources of certain types.
class IMessageListener
An interface that can receive messages sent through the app.

Constructors, destructors, conversion operators

cPropManager()
~cPropManager() virtual

Public functions

auto HandleMessage(uint32_t messageID, void* msg) -> bool override
Called every time a message is received.
auto GetType() -> uint32_t override
auto CreateResource(IPFRecord* pRecord, ResourceObject*& pDst, int, uint32_t typeID) -> bool override
Creates a new resource of the specified type, using the file record given.
auto AsyncAccess(IPFRecord** ppDst, int, DBPF* pDBPF, int, int, int) -> bool override
auto Read(IPFRecord* pRecord, ResourceObject* pResource, int, uint32_t typeID) -> bool override
Reads the data into the resource given.
auto Write(ResourceObject* pResource, IPFRecord* pRecord, int, uint32_t typeID) -> bool override
Reads the resource into the file given.
auto GetSupportedTypes(uint32_t* pDstTypes, size_t count) const -> size_t override
This method must tell all the type IDs that are accepted by this factory.
auto IsValid(uint32_t typeID, uint32_t subTypeID) -> bool override
This method must tell whether this type ID (which might be a generic one, e.g.
auto AddRef() -> int override
auto Release() -> int override
void func08h(bool value) override
auto Initialize() -> bool override
void PreloadPropertyLists() override
auto Dispose() -> bool override
auto GetPropertyID(const char* propertyName, uint32_t& result) const -> bool override
Gets the ID that corresponds to the given property name.
auto GetPropertyName(uint32_t propertyID) const -> const char* override
Gets the name that is mapped to the given propertyID.
auto func20h(int arg_0, int arg_4) -> void* override
auto GetPropertyGroupName(uint32_t propertyGroupID) const -> const char* override
Gets the name assigned to the given property group ID.
auto HasPropertyList(uint32_t instanceID, uint32_t groupID) const -> bool override
Tells whether a PropertyList with the given instanceID and groupID is contained in this manager.
auto GetPropertyList(uint32_t instanceID, uint32_t groupID, PropertyList::Pointer& pDst) const -> bool override
Gets the PropertyList stored in the given group and with the given instanceID.
auto GetGlobalPropertyList(uint32_t instanceID, PropertyList::Pointer& pDst) -> bool override
Gets the PropertyList stored in the global (0x00000000) folder and with the given instanceID.
void SetPropertyList(PropertyList* pList, uint32_t instanceID, uint32_t groupID) override
Adds this property list with the given instance and group ID, or replaces the existing one.
auto func38h(int arg_0) -> void* override
auto func3Ch(int arg_0, int arg_4) -> void* override
auto func40h(int arg_0, int arg_4, const vector<uint32_t>& instanceIDs) -> void* override
auto func44h(size_t nCount, const vector<ResourceKey>& names) -> bool override
auto GetAllListIDs(uint32_t groupID, vector<uint32_t>& result) const -> bool override
Gets the instance IDs of all the PropertyList objects contained in the specified group.
auto func4Ch(int arg_0, int arg_4) -> void* override
auto GetPropertyDefinition(uint32_t propertyID) const -> const Property* override
Gets the property definition of the property with the given ID.
auto GetPropertyGroupsCount() const -> size_t override
Gets the number of property groups contained in this manager.
auto GetPropertyGroupIDAt(size_t index, uint32_t& dst) const -> bool override
Gets the ID of the property group at the given index.

Protected variables

int field_10
bool mbIsInitialized
bool field_15
IResourceManager* mpResourceMgr
bool field_1C
map<uint32_t, Property> field_20
PropertyList mPropertyDefinitions
hash_map<ResourceID, PropertyList::Pointer> mPropertyLists
hash_map<string, uint32_t> mNamesToPropertyIDs
hash_map<uint32_t, string> mPropertyIDsToNames
hash_map<string, int> field_D4
hash_map<uint32_t, string> mPropertyGroupNames
vector<uint32_t> mPropertyGroupIDs
hash_map<int, int> field_128
hash_map<int, int> field_148
string mCurrentPropertyName
int field_178
intrusive_ptr<ArgScript::FormatParser> field_17C
string field_180
ArgScript::Line field_190
int field_1D4
string field_1D8
bool mbAddToAppProperties

Function documentation

bool App::cPropManager::HandleMessage(uint32_t messageID, void* msg) override

Called every time a message is received.

Parameters
messageID The ID of the message received.
msg The data of the message received, it might be nullptr.
Returns Whether the message was handled or not.

Only the messages with an ID this listened signed up for will call this event.

bool App::cPropManager::CreateResource(IPFRecord* pRecord, ResourceObject*& pDst, int, uint32_t typeID) override

Creates a new resource of the specified type, using the file record given.

Parameters
pRecord The IPFRecord that points to the file used by the resource (either for reading or for writing).
pDst out A pointer where the ResourceObject created must be written.
typeID The type ID of the file to read, which might be used to differentiate between different file formats or resource types.

bool App::cPropManager::Read(IPFRecord* pRecord, ResourceObject* pResource, int, uint32_t typeID) override

Reads the data into the resource given.

Parameters
pRecord The IPFRecord that points to the file that must be read.
pResource The ResourceObject where the data must be loaded.
typeID The type ID of the file to read, which might be used to differentiate between different file formats.

bool App::cPropManager::Write(ResourceObject* pResource, IPFRecord* pRecord, int, uint32_t typeID) override

Reads the resource into the file given.

Parameters
pResource The ResourceObject that must be saved.
pRecord The IPFRecord that points to the file that must be written.
typeID The type ID of the file to write, which might be used to differentiate between different file formats.

size_t App::cPropManager::GetSupportedTypes(uint32_t* pDstTypes, size_t count) const override

This method must tell all the type IDs that are accepted by this factory.

Parameters
pDstTypes out The uint32_t array where the type IDs must be written.
count The size of the pDstTypes array.
Returns How many type IDs are supported.

The method must return how many type IDs are supported.

bool App::cPropManager::IsValid(uint32_t typeID, uint32_t subTypeID) override

This method must tell whether this type ID (which might be a generic one, e.g.

Parameters
typeID
subTypeID

.image) and the sub type ID (e.g. .png) are accepted by this factory. The subtypeID might be 0, in which case only the type ID matters.

bool App::cPropManager::GetPropertyID(const char* propertyName, uint32_t& result) const override

Gets the ID that corresponds to the given property name.

Parameters
propertyName The name of the property.
result out The uint32_t that will receive the ID.
Returns Whether the name was found or not.

This function will only work for those names that are mapped in this manager.

const char* App::cPropManager::GetPropertyName(uint32_t propertyID) const override

Gets the name that is mapped to the given propertyID.

Parameters
propertyID The ID of the property.
Returns The name of the property, or nullptr if it is not mapped.

This function will only work for those names that are mapped in this manager.

const char* App::cPropManager::GetPropertyGroupName(uint32_t propertyGroupID) const override

Gets the name assigned to the given property group ID.

Parameters
propertyGroupID The ID of the property group.
Returns The name of the group, or nullptr if it is not mapped.

This function will only work if that group is mapped in this manager.

bool App::cPropManager::HasPropertyList(uint32_t instanceID, uint32_t groupID) const override

Tells whether a PropertyList with the given instanceID and groupID is contained in this manager.

Parameters
instanceID The instance ID of the list.
groupID The group ID of the list.
Returns True if the list exists, false otherwise.

bool App::cPropManager::GetPropertyList(uint32_t instanceID, uint32_t groupID, PropertyList::Pointer& pDst) const override

Gets the PropertyList stored in the given group and with the given instanceID.

Parameters
instanceID The instance ID of the list.
groupID The group ID of the list.
pDst An intrusive_ptr that will receive the list. It must not be initialized or contain nullptr; the previous pointer won't be released.
Returns Whether the list was found or not.

bool App::cPropManager::GetGlobalPropertyList(uint32_t instanceID, PropertyList::Pointer& pDst) override

Gets the PropertyList stored in the global (0x00000000) folder and with the given instanceID.

Parameters
instanceID The instance ID of the list.
pDst An intrusive_ptr that will receive the list. It must not be initialized or contain nullptr; the previous pointer won't be released.
Returns Whether the list was found or not.

void App::cPropManager::SetPropertyList(PropertyList* pList, uint32_t instanceID, uint32_t groupID) override

Adds this property list with the given instance and group ID, or replaces the existing one.

Parameters
pList The new PropertyList.
instanceID The instance ID of the property list.
groupID The group ID of the property list.

bool App::cPropManager::GetAllListIDs(uint32_t groupID, vector<uint32_t>& result) const override

Gets the instance IDs of all the PropertyList objects contained in the specified group.

Parameters
groupID The ID of the group where the lists are (i.e. the folder)
result out A uint32_t vector that will receive the instance IDs.

const Property* App::cPropManager::GetPropertyDefinition(uint32_t propertyID) const override

Gets the property definition of the property with the given ID.

Parameters
propertyID The ID of the property.
Returns The Property that contains the type and default value, or nullptr if there is no definition for that property.

The definition is a Property object that contains the type and default value of the property. Definitions are stored in the Properties.txt, AppProperties.txt, etc files.

bool App::cPropManager::GetPropertyGroupIDAt(size_t index, uint32_t& dst) const override

Gets the ID of the property group at the given index.

Parameters
index The index of the group inside this manager.
dst out The uint32_t that will receive the ID.
Returns Whether the index was valid or not.