IEntityClassRegistry

C++
struct IEntityClassRegistry {
  struct SEntityClassDesc {
    int flags;
    const char* sName;
    const char* sScriptFile;
    SEditorClassInfo editorClassInfo;
    IEntityClass::UserProxyCreateFunc pUserProxyCreateFunc;
    void* pUserProxyData;
    IEntityPropertyHandler* pPropertyHandler;
    IEntityEventHandler* pEventHandler;
    IEntityScriptFileHandler* pScriptFileHandler;
  };
};
File

IEntityClass.h

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
IEntityClassRegistry::SEntityClassDesc Structure
C++
File

IEntityClass.h

IEntityClassRegistry::SEntityClassDesc::editorClassInfo Data Member
C++
SEditorClassInfo editorClassInfo;
IEntityClassRegistry::SEntityClassDesc::flags Data Member
C++
int flags;
IEntityClassRegistry::SEntityClassDesc::pEventHandler Data Member
C++
IEntityEventHandler* pEventHandler;
IEntityClassRegistry::SEntityClassDesc::pPropertyHandler Data Member
C++
IEntityPropertyHandler* pPropertyHandler;
IEntityClassRegistry::SEntityClassDesc::pScriptFileHandler Data Member
C++
IEntityScriptFileHandler* pScriptFileHandler;
IEntityClassRegistry::SEntityClassDesc::pUserProxyCreateFunc Data Member
C++
IEntityClass::UserProxyCreateFunc pUserProxyCreateFunc;
IEntityClassRegistry::SEntityClassDesc::pUserProxyData Data Member
C++
void* pUserProxyData;
IEntityClassRegistry::SEntityClassDesc::sName Data Member
C++
const char* sName;
IEntityClassRegistry::SEntityClassDesc::sScriptFile Data Member
C++
const char* sScriptFile;
IEntityClassRegistry::SEntityClassDesc::SEntityClassDesc Constructor
C++
SEntityClassDesc();
IEntityClassRegistry::~IEntityClassRegistry Destructor
C++
IEntityClassRegistry::FindClass Method
C++
virtual IEntityClass* FindClass(const char * sClassName) const = 0;
Returns

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

Description

Retrieves pointer to the IEntityClass interface by entity class name.

IEntityClassRegistry::GetClassCount Method
C++
virtual int GetClassCount() const = 0;
Returns

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

Description

Return the number of entity classes in the registry.

IEntityClassRegistry::GetDefaultClass Method
C++
virtual IEntityClass* GetDefaultClass() const = 0;
Returns

Pointer to the IEntityClass interface, It can never return NULL.

Description

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

IEntityClassRegistry::IteratorMoveFirst Method
C++
virtual void IteratorMoveFirst() = 0;
Description

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

IEntityClassRegistry::IteratorNext Method
C++
virtual IEntityClass* IteratorNext() = 0;
Returns

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

Description

Get the next entity class in the registry.

IEntityClassRegistry::LoadClasses Method
C++
virtual void LoadClasses(const char * sPath, bool bOnlyNewClasses = false) = 0;
Parameters
Parameters
Description
const char * sPath
Path where to search for .ent files.
Description

Load all entity class description xml files with extension ".ent" from specified directory.

IEntityClassRegistry::RegisterClass Method
C++
virtual bool RegisterClass(IEntityClass * pClass) = 0;
Returns

true if successfully registered.

Description

Register a new entity class.

IEntityClassRegistry::RegisterStdClass Method
C++
virtual IEntityClass* RegisterStdClass(const SEntityClassDesc & entityClassDesc) = 0;
Returns

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

Description

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

IEntityClassRegistry::UnregisterClass Method
C++
virtual bool UnregisterClass(IEntityClass * pClass) = 0;
Returns

true if successfully unregistered.

Description

Unregister an entity class.