#include
Classes | |
struct | SEventInfo |
Events info for this entity class. More... | |
Public Types | |
enum | EventValueType { EVT_INT, EVT_FLOAT, EVT_BOOL, EVT_VECTOR, EVT_ENTITY, EVT_STRING } |
typedef std::function< bool(IEntity &entity, SEntitySpawnParams ¶ms)> | OnSpawnCallback |
typedef IEntityComponent *(* | UserProxyCreateFunc) (IEntity *pEntity, SEntitySpawnParams ¶ms, void *pUserData) |
Public Member Functions | |
virtual void | Release ()=0 |
Destroy IEntityClass object, do not call directly, only EntityRegisty can destroy entity classes. | |
virtual const char * | GetName () const =0 |
virtual CryGUID | GetGUID () const =0 |
Retrieve unique identifier for this entity class. | |
virtual uint32 | GetFlags () const =0 |
virtual void | SetFlags (uint32 nFlags)=0 |
Set entity class flags. | |
virtual const char * | GetScriptFile () const =0 |
virtual IEntityScript * | GetIEntityScript () const =0 |
virtual IScriptTable * | GetScriptTable () const =0 |
virtual IEntityEventHandler * | GetEventHandler () const =0 |
virtual IEntityScriptFileHandler * | GetScriptFileHandler () const =0 |
virtual const SEditorClassInfo & | GetEditorClassInfo () const =0 |
virtual void | SetEditorClassInfo (const SEditorClassInfo &editorClassInfo)=0 |
virtual bool | LoadScript (bool bForceReload)=0 |
virtual IEntityClass::UserProxyCreateFunc | GetUserProxyCreateFunc () const =0 |
virtual void * | GetUserProxyData () const =0 |
virtual int | GetEventCount ()=0 |
virtual IEntityClass::SEventInfo | GetEventInfo (int nIndex)=0 |
virtual bool | FindEventInfo (const char *sEvent, SEventInfo &event)=0 |
virtual const OnSpawnCallback & | GetOnSpawnCallback () const =0 |
Return On spawn callback for the class. | |
virtual void | GetMemoryUsage (ICrySizer *pSizer) const =0 |
Entity class defines what is this entity, what script it uses, what user proxy will be spawned with the entity, etc. IEntityClass unique identify type of the entity, Multiple entities share the same entity class. Two entities can be compared if they are of the same type by just comparing their IEntityClass pointers.
typedef std::function |
OnSpawnCallback is called when entity of that class is spawned. When registering new entity class this callback allow user to execute custom code on entity spawn, Like creation and initialization of some default components
typedef IEntityComponent*(* IEntityClass::UserProxyCreateFunc) (IEntity *pEntity, SEntitySpawnParams ¶ms, void *pUserData) |
UserProxyCreateFunc is a function pointer type,. By calling this function EntitySystem can create user defined UserProxy class for an entity in SpawnEntity. For example: IEntityComponent* CreateUserProxy( IEntity *pEntity, SEntitySpawnParams ¶ms ) { return new CUserProxy( pEntity,params );. }
|
pure virtual |
Find event by name.
sEvent | Name of the event. |
event | Output parameter for event. |
|
pure virtual |
|
pure virtual |
Retrieve information about input/output event of the entity.
nIndex | Index of the event to retrieve, must be in 0 to GetEventCount()-1 range. |
|
pure virtual |
|
pure virtual |
Returns the IEntityScript interface assigned for this entity class.
|
pure virtual |
If this entity also uses a script, this is the name of the Lua table representing the entity behavior.
|
pure virtual |
Returns the Lua script file name.
|
pure virtual |
Returns the IScriptTable interface assigned for this entity class.
|
pure virtual |
Returns pointer to the user defined function to create UserProxy.
|
pure virtual |
Returns pointer to the user defined data to be passed when creating UserProxy.
|
pure virtual |
Loads the script.