Isle
Loading...
Searching...
No Matches
mxentity.h
Go to the documentation of this file.
1#ifndef MXENTITY_H
2#define MXENTITY_H
3
4#include "decomp.h"
5#include "mxatom.h"
6#include "mxcore.h"
7#include "mxdsaction.h"
8#include "mxtypes.h"
9
10// VTABLE: LEGO1 0x100d5390 [AI]
11// VTABLE: BETA10 0x101b93e8 [AI]
12// SIZE 0x10 [AI]
13
22class MxEntity : public MxCore {
23public:
27 // FUNCTION: LEGO1 0x1001d190 [AI]
28 MxEntity() { m_entityId = -1; }
29
33 // FUNCTION: LEGO1 0x1000c110 [AI]
34 ~MxEntity() override {}
35
40 // FUNCTION: LEGO1 0x1000c180 [AI]
41 // FUNCTION: BETA10 0x10012700 [AI]
42 const char* ClassName() const override // vtable+0x0c [AI]
43 {
44 // STRING: LEGO1 0x100f0070 [AI]
45 return "MxEntity";
46 }
47
54 // FUNCTION: LEGO1 0x1000c190 [AI]
55 // FUNCTION: BETA10 0x10012610 [AI]
56 MxBool IsA(const char* p_name) const override // vtable+0x10 [AI]
57 {
58 return !strcmp(p_name, MxEntity::ClassName()) || MxCore::IsA(p_name);
59 }
60
67 // FUNCTION: LEGO1 0x10001070 [AI]
68 // FUNCTION: BETA10 0x1000f3a0 [AI]
69 virtual MxResult Create(MxS32 p_entityId, const MxAtomId& p_atomId)
70 {
71 m_entityId = p_entityId;
72 m_atomId = p_atomId;
73 return SUCCESS;
74 } // vtable+0x14 [AI]
75
83 {
84 m_entityId = p_dsAction.GetObjectId();
85 m_atomId = p_dsAction.GetAtomId();
86 return SUCCESS;
87 }
88
92 // FUNCTION: BETA10 0x10031c60 [AI]
94
99
104 void SetEntityId(MxS32 p_entityId) { m_entityId = p_entityId; }
105
110 void SetAtomId(const MxAtomId& p_atomId) { m_atomId = p_atomId; }
111
112 // SYNTHETIC: LEGO1 0x1000c210 [AI]
113 // MxEntity::`scalar deleting destructor' [AI]
114
115protected:
119 MxS32 m_entityId; // 0x08 [AI]
120
124 MxAtomId m_atomId; // 0x0c [AI]
125};
126
127#endif // MXENTITY_H
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
Definition: mxcore.h:46
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
Definition: mxdsobject.h:133
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
Definition: mxdsobject.h:130
MxEntity is a base class for game entities which are uniquely identified by an integer ID and an Atom...
Definition: mxentity.h:22
MxAtomId & GetAtomId()
Returns a reference to the entity AtomId.
Definition: mxentity.h:98
MxS32 GetEntityId()
Returns the current entity ID.
Definition: mxentity.h:93
MxAtomId m_atomId
The AtomId associated with this entity, used for resource and script identification.
Definition: mxentity.h:124
MxEntity()
Default constructor.
Definition: mxentity.h:28
virtual MxResult Create(MxS32 p_entityId, const MxAtomId &p_atomId)
Initializes the entity from a given entity ID and AtomId.
Definition: mxentity.h:69
void SetEntityId(MxS32 p_entityId)
Sets the entity ID to the given value.
Definition: mxentity.h:104
const char * ClassName() const override
Returns the class name for type introspection.
Definition: mxentity.h:42
~MxEntity() override
Virtual destructor for MxEntity.
Definition: mxentity.h:34
MxS32 m_entityId
The unique entity ID, typically used for lookup and reference.
Definition: mxentity.h:119
MxBool IsA(const char *p_name) const override
Checks if the object is of the given class name or a parent type.
Definition: mxentity.h:56
MxResult Create(MxDSAction &p_dsAction)
Initializes the entity from a MxDSAction object.
Definition: mxentity.h:82
void SetAtomId(const MxAtomId &p_atomId)
Sets the AtomId to the given value.
Definition: mxentity.h:110
#define override
Definition: compat.h:21
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
signed int MxS32
[AI]
Definition: mxtypes.h:38