IEntityClassRegistry

IEntityClassRegistryabstract

#include

Public Member Functions

virtual IEntityClass * FindClass (const char *sClassName) const =0
virtual IEntityClass * FindClassByGUID (const CryGUID &guid) const =0
virtual IEntityClass * GetDefaultClass () const =0
virtual void LoadClasses (const char *szFilename, bool bOnlyNewClasses=false)=0
virtual IEntityClass * RegisterStdClass (const SEntityClassDesc &entityClassDesc)=0
virtual bool UnregisterStdClass (const CryGUID &classGUID)=0
virtual void RegisterListener (IEntityClassRegistryListener *pListener)=0
Register a listener.
virtual void UnregisterListener (IEntityClassRegistryListener *pListener)=0
Unregister a listener.
virtual void UnregisterSchematycEntityClass ()=0
virtual void IteratorMoveFirst ()=0
virtual IEntityClass * IteratorNext ()=0
virtual int GetClassCount () const =0

Detailed Description

This interface is the repository of the the various entity classes, it allows creation and modification of entities types. There`s only one IEntityClassRegistry interface can exist per EntitySystem. Every entity class that can be spawned must be registered in this interface.

See also
IEntitySystem::GetClassRegistry

Member Function Documentation

◆ FindClass()

virtual IEntityClass* IEntityClassRegistry::FindClass ( const char * sClassName) const
pure virtual

Retrieves pointer to the IEntityClass interface by entity class name.

Returns
Pointer to the IEntityClass interface, or nullptr if class not found.

◆ FindClassByGUID()

virtual IEntityClass* IEntityClassRegistry::FindClassByGUID ( const CryGUID & guid) const
pure virtual

Retrieves pointer to the IEntityClass interface by GUID.

Returns
Pointer to the IEntityClass interface, or nullptr if class not found.

◆ GetClassCount()

virtual int IEntityClassRegistry::GetClassCount ( ) const
pure virtual

Return the number of entity classes in the registry.

Returns
Return a pointer to the next IEntityClass interface, or nullptr if is the end

◆ GetDefaultClass()

virtual IEntityClass* IEntityClassRegistry::GetDefaultClass ( ) const
pure virtual

Retrieves pointer to the IEntityClass interface for a default entity class.

Returns
Pointer to the IEntityClass interface, It can never return nullptr.

◆ IteratorMoveFirst()

virtual void IEntityClassRegistry::IteratorMoveFirst ( )
pure virtual

Move the entity class iterator to the begin of the registry. To iterate over all entity classes, e.g.: IEntityClass *pClass = nullptr; for (pEntityRegistry->IteratorMoveFirst(); pClass = pEntityRegistry->IteratorNext();;) { pClass ... }

◆ IteratorNext()

virtual IEntityClass* IEntityClassRegistry::IteratorNext ( )
pure virtual

Get the next entity class in the registry.

Returns
Return a pointer to the next IEntityClass interface, or nullptr if is the end

◆ LoadClasses()

virtual void IEntityClassRegistry::LoadClasses ( const char * szFilename,
bool bOnlyNewClasses = false
)
pure virtual

Load all entity class descriptions from the provided xml file.

Parameters
szFilenamePath to XML file containing entity class descriptions.

◆ RegisterStdClass()

virtual IEntityClass* IEntityClassRegistry::RegisterStdClass ( const SEntityClassDesc & entityClassDesc)
pure virtual

Register standard entity class, if class id not specified (is zero), generate a new class id.

Returns
Pointer to the new created and registered IEntityClass interface, or nullptr if failed.

◆ UnregisterStdClass()

virtual bool IEntityClassRegistry::UnregisterStdClass ( const CryGUID & classGUID)
pure virtual

Unregister an entity class.

Returns
true if successfully unregistered.