Isle
Loading...
Searching...
No Matches
MxEntity Class Reference

MxEntity is a base class for game entities which are uniquely identified by an integer ID and an AtomId. More...

#include <mxentity.h>

Inheritance diagram for MxEntity:
Collaboration diagram for MxEntity:

Public Member Functions

 MxEntity ()
 Default constructor. More...
 
 ~MxEntity () override
 Virtual destructor for MxEntity. More...
 
const char * ClassName () const override
 Returns the class name for type introspection. More...
 
MxBool IsA (const char *p_name) const override
 Checks if the object is of the given class name or a parent type. More...
 
virtual MxResult Create (MxS32 p_entityId, const MxAtomId &p_atomId)
 Initializes the entity from a given entity ID and AtomId. More...
 
MxResult Create (MxDSAction &p_dsAction)
 Initializes the entity from a MxDSAction object. More...
 
MxS32 GetEntityId ()
 Returns the current entity ID. More...
 
MxAtomIdGetAtomId ()
 Returns a reference to the entity AtomId. More...
 
void SetEntityId (MxS32 p_entityId)
 Sets the entity ID to the given value. More...
 
void SetAtomId (const MxAtomId &p_atomId)
 Sets the AtomId to the given value. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Protected Attributes

MxS32 m_entityId
 The unique entity ID, typically used for lookup and reference. More...
 
MxAtomId m_atomId
 The AtomId associated with this entity, used for resource and script identification. More...
 

Detailed Description

MxEntity is a base class for game entities which are uniquely identified by an integer ID and an AtomId.

[AI]

[AI] MxEntity provides a unified interface for all world entities and supplies mechanisms for type information, unique identity, and entity initialization from basic parameters or from a data action (MxDSAction). Used as an ancestor for most LEGO Island actor and entity classes.

Definition at line 22 of file mxentity.h.

Constructor & Destructor Documentation

◆ MxEntity()

MxEntity::MxEntity ( )
inline

Default constructor.

Initializes entity ID to -1 (invalid). [AI]

Definition at line 28 of file mxentity.h.

◆ ~MxEntity()

MxEntity::~MxEntity ( )
inlineoverride

Virtual destructor for MxEntity.

[AI]

Definition at line 34 of file mxentity.h.

Member Function Documentation

◆ ClassName()

const char * MxEntity::ClassName ( ) const
inlineoverridevirtual

Returns the class name for type introspection.

[AI]

Returns
String literal "MxEntity" [AI]

Reimplemented from MxCore.

Definition at line 42 of file mxentity.h.

◆ Create() [1/2]

MxResult MxEntity::Create ( MxDSAction p_dsAction)
inline

Initializes the entity from a MxDSAction object.

[AI]

Parameters
p_dsActionReference to action with object identification data. [AI]
Returns
SUCCESS on completion. [AI]

[AI] Sets m_entityId and m_atomId to the values from the DSAction.

Definition at line 82 of file mxentity.h.

◆ Create() [2/2]

virtual MxResult MxEntity::Create ( MxS32  p_entityId,
const MxAtomId p_atomId 
)
inlinevirtual

Initializes the entity from a given entity ID and AtomId.

[AI]

Parameters
p_entityIdThe integer entity ID to assign. [AI]
p_atomIdThe AtomId to assign. [AI]
Returns
SUCCESS on completion. [AI]

Definition at line 69 of file mxentity.h.

◆ GetAtomId()

MxAtomId & MxEntity::GetAtomId ( )
inline

Returns a reference to the entity AtomId.

[AI]

Definition at line 98 of file mxentity.h.

◆ GetEntityId()

MxS32 MxEntity::GetEntityId ( )
inline

Returns the current entity ID.

[AI]

Definition at line 93 of file mxentity.h.

◆ IsA()

MxBool MxEntity::IsA ( const char *  p_name) const
inlineoverridevirtual

Checks if the object is of the given class name or a parent type.

[AI]

Parameters
p_nameThe class name to compare against. [AI]

[AI] Returns true if the name matches the MxEntity class or matches any parent class via MxCore::IsA.

Reimplemented from MxCore.

Definition at line 56 of file mxentity.h.

◆ SetAtomId()

void MxEntity::SetAtomId ( const MxAtomId p_atomId)
inline

Sets the AtomId to the given value.

[AI]

Parameters
p_atomIdValue to assign to m_atomId. [AI]

Definition at line 110 of file mxentity.h.

◆ SetEntityId()

void MxEntity::SetEntityId ( MxS32  p_entityId)
inline

Sets the entity ID to the given value.

[AI]

Parameters
p_entityIdNew ID value to set. [AI]

Definition at line 104 of file mxentity.h.

Member Data Documentation

◆ m_atomId

MxAtomId MxEntity::m_atomId
protected

The AtomId associated with this entity, used for resource and script identification.

[AI]

Definition at line 124 of file mxentity.h.

◆ m_entityId

MxS32 MxEntity::m_entityId
protected

The unique entity ID, typically used for lookup and reference.

[AI]

Definition at line 119 of file mxentity.h.


The documentation for this class was generated from the following file: