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

[AI] Base class for any object deserialized from an SI (script/data) file in the LEGO Island engine. More...

#include <mxdsobject.h>

Inheritance diagram for MxDSObject:
Collaboration diagram for MxDSObject:

Public Types

enum  Type {
  e_object = 0 , e_action , e_mediaAction , e_anim ,
  e_sound , e_multiAction , e_serialAction , e_parallelAction ,
  e_event , e_selectAction , e_still , e_objectAction
}
 [AI] Enumerated type value for each kind of DS object. More...
 

Public Member Functions

 MxDSObject ()
 [AI] Default constructor. Initializes to e_object and clears names and pointers. More...
 
 ~MxDSObject () override
 [AI] Destructor. Frees allocated objectName/sourceName memory. More...
 
void CopyFrom (MxDSObject &p_dsObject)
 [AI] Copy data from another MxDSObject, performing deep string copy for names. More...
 
 MxDSObject (MxDSObject &p_dsObject)
 [AI] Copy constructor. More...
 
MxDSObjectoperator= (MxDSObject &p_dsObject)
 [AI] Assignment operator. More...
 
void SetObjectName (const char *p_objectName)
 [AI] Sets object (internal) unique name; deep copies the string. More...
 
void SetSourceName (const char *p_sourceName)
 [AI] Sets the source name (usually source SI file); deep copies the string. More...
 
const char * ClassName () const override
 [AI] Returns the class identifier string for run-time type ID. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Runtime type check; supports derived/parent class lookup by name. More...
 
virtual undefined4 VTable0x14 ()
 [AI] Placeholder for early vtable slot (purpose unknown, may be used for RTTI). More...
 
virtual MxU32 GetSizeOnDisk ()
 [AI] Calculates serialized size of this object on disk (for buffer allocation). More...
 
virtual void Deserialize (MxU8 *&p_source, MxS16 p_unk0x24)
 [AI] Initializes this object from serialized (memory buffer) data. More...
 
virtual void SetAtomId (MxAtomId p_atomId)
 [AI] Sets the atom id for this object instance, used for indexing or lookup. More...
 
Type GetType () const
 [AI] Returns the object's type enum as stored in m_type. More...
 
const char * GetSourceName () const
 [AI] Returns the source name string (typically the originating SI file). More...
 
const char * GetObjectName () const
 [AI] Returns the object name string. More...
 
MxU32 GetObjectId ()
 [AI] Returns the object id numeric value. More...
 
const MxAtomIdGetAtomId ()
 [AI] Returns a const-reference to the object's atom identifier. More...
 
MxS16 GetUnknown24 ()
 [AI] Returns the unknown 0x24 value (may be data version or usage state). [AI] More...
 
MxPresenterGetUnknown28 ()
 [AI] Returns the pointer stored at 0x28, likely a presenter or handler for this DS object. More...
 
void SetType (Type p_type)
 [AI] Sets the DS object type. More...
 
void SetObjectId (MxU32 p_objectId)
 [AI] Sets the object id (for serialization or lookup). More...
 
void SetUnknown24 (MxS16 p_unk0x24)
 [AI] Sets the unknown field at 0x24 (possibly version/state). More...
 
void SetUnknown28 (MxPresenter *p_unk0x28)
 [AI] Sets the pointer at 0x28 (presenter or handler). More...
 
void ClearAtom ()
 [AI] Clears the atom id, releasing its association. 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

MxU32 m_sizeOnDisk
 [AI] Cached/calculated disk size of object data for serialization. [AI] More...
 
MxU16 m_type
 [AI] Object type enum (see Type) as read from data or set in code. [AI] More...
 
char * m_sourceName
 [AI] Heap copy: SI file or source identifier string. [AI] More...
 
undefined4 m_unk0x14
 [AI] Unknown usage, possibly flags or reserved SI-format field. [AI] More...
 
char * m_objectName
 [AI] Heap copy: Logical object name as referenced in script/data. [AI] More...
 
MxU32 m_objectId
 [AI] Numeric id (unique per file or context, often -1). [AI] More...
 
MxAtomId m_atomId
 [AI] String/value pair for engine lookup/reference. [AI] More...
 
MxS16 m_unk0x24
 [AI] Unknown usage, possibly used for context or flags during loading. [AI] More...
 
MxPresenterm_unk0x28
 [AI] Presenter or handler associated to this object (may be null). [AI] More...
 

Detailed Description

[AI] Base class for any object deserialized from an SI (script/data) file in the LEGO Island engine.

[AI] Represents a deserialized data object with identifiers, type, and names, used for collection, dispatch, and presenter instantiation. The class includes serialization information, atom ids (for identifying unique objects/resources), and ties to the presenter system. [AI_SUGGESTED_NAME: DataSequenceObject]

Definition at line 44 of file mxdsobject.h.

Member Enumeration Documentation

◆ Type

[AI] Enumerated type value for each kind of DS object.

[AI]

Enumerator
e_object 

[AI] Base object, most basic type. [AI]

e_action 

[AI] Simple action or command invocation. [AI]

e_mediaAction 

[AI] Media-related action (usually for videos, audio, etc). [AI]

e_anim 

[AI] Animation sequence or reference. [AI]

e_sound 

[AI] Sound resource reference or cue. [AI]

e_multiAction 

[AI] Composite/multi-action list. [AI]

e_serialAction 

[AI] Series of actions to play in order. [AI]

e_parallelAction 

[AI] Parallel (simultaneous) action list. [AI]

e_event 

[AI] Scripted event type. [AI]

e_selectAction 

[AI] Selects an action from several (with rules/random). [AI]

e_still 

[AI] Still image resource. [AI]

e_objectAction 

[AI] Placeholder for generic object operations. [AI]

Definition at line 48 of file mxdsobject.h.

Constructor & Destructor Documentation

◆ MxDSObject() [1/2]

MxDSObject::MxDSObject ( )

[AI] Default constructor. Initializes to e_object and clears names and pointers.

Definition at line 25 of file mxdsobject.cpp.

◆ ~MxDSObject()

MxDSObject::~MxDSObject ( )
override

[AI] Destructor. Frees allocated objectName/sourceName memory.

Definition at line 38 of file mxdsobject.cpp.

◆ MxDSObject() [2/2]

MxDSObject::MxDSObject ( MxDSObject p_dsObject)

[AI] Copy constructor.

[AI]

Parameters
p_dsObjectSource MxDSObject. [AI]

Definition at line 58 of file mxdsobject.cpp.

Member Function Documentation

◆ ClassName()

const char * MxDSObject::ClassName ( ) const
inlineoverridevirtual

[AI] Returns the class identifier string for run-time type ID.

Returns
Pointer to literal class name string. [AI]

Reimplemented from MxCore.

Reimplemented in MxDSObjectAction, MxDSParallelAction, MxDSSelectAction, MxDSSerialAction, MxDSSound, and MxDSStill.

Definition at line 92 of file mxdsobject.h.

◆ ClearAtom()

void MxDSObject::ClearAtom ( )
inline

[AI] Clears the atom id, releasing its association.

Definition at line 158 of file mxdsobject.h.

◆ CopyFrom()

void MxDSObject::CopyFrom ( MxDSObject p_dsObject)

[AI] Copy data from another MxDSObject, performing deep string copy for names.

Parameters
p_dsObjectSource MxDSObject to copy from. [AI]

Definition at line 46 of file mxdsobject.cpp.

◆ Deserialize()

void MxDSObject::Deserialize ( MxU8 *&  p_source,
MxS16  p_unk0x24 
)
virtual

[AI] Initializes this object from serialized (memory buffer) data.

Parameters
p_sourceReference to pointer for in-place buffer decoding, pointer is advanced. [AI]
p_unk0x24Likely data version or additional context flag. [AI] [AI] Sets object/source names, object id, and type flag from the provided buffer.

Reimplemented in MxDSAction, MxDSMediaAction, MxDSMultiAction, MxDSSelectAction, and MxDSSound.

Definition at line 159 of file mxdsobject.cpp.

◆ GetAtomId()

const MxAtomId & MxDSObject::GetAtomId ( )
inline

[AI] Returns a const-reference to the object's atom identifier.

Definition at line 133 of file mxdsobject.h.

◆ GetObjectId()

MxU32 MxDSObject::GetObjectId ( )
inline

[AI] Returns the object id numeric value.

Definition at line 130 of file mxdsobject.h.

◆ GetObjectName()

const char * MxDSObject::GetObjectName ( ) const
inline

[AI] Returns the object name string.

Definition at line 127 of file mxdsobject.h.

◆ GetSizeOnDisk()

MxU32 MxDSObject::GetSizeOnDisk ( )
virtual

[AI] Calculates serialized size of this object on disk (for buffer allocation).

Returns
Size in bytes needed to serialize this object. [AI]

Reimplemented in MxDSAction, MxDSMediaAction, MxDSMultiAction, MxDSSelectAction, and MxDSSound.

Definition at line 129 of file mxdsobject.cpp.

◆ GetSourceName()

const char * MxDSObject::GetSourceName ( ) const
inline

[AI] Returns the source name string (typically the originating SI file).

Definition at line 124 of file mxdsobject.h.

◆ GetType()

Type MxDSObject::GetType ( ) const
inline

[AI] Returns the object's type enum as stored in m_type.

Definition at line 121 of file mxdsobject.h.

◆ GetUnknown24()

MxS16 MxDSObject::GetUnknown24 ( )
inline

[AI] Returns the unknown 0x24 value (may be data version or usage state). [AI]

Definition at line 136 of file mxdsobject.h.

◆ GetUnknown28()

MxPresenter * MxDSObject::GetUnknown28 ( )
inline

[AI] Returns the pointer stored at 0x28, likely a presenter or handler for this DS object.

Definition at line 139 of file mxdsobject.h.

◆ IsA()

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

[AI] Runtime type check; supports derived/parent class lookup by name.

Parameters
p_nameType name to compare. [AI]
Returns
True if type matches this or any base type. [AI]

Reimplemented from MxCore.

Reimplemented in MxDSObjectAction, MxDSParallelAction, MxDSSelectAction, MxDSSerialAction, MxDSSound, and MxDSStill.

Definition at line 97 of file mxdsobject.h.

◆ operator=()

MxDSObject & MxDSObject::operator= ( MxDSObject p_dsObject)

[AI] Assignment operator.

Deep-copies fields. [AI]

Parameters
p_dsObjectSource to assign from. [AI]
Returns
Reference to this object. [AI]

Definition at line 65 of file mxdsobject.cpp.

◆ SetAtomId()

virtual void MxDSObject::SetAtomId ( MxAtomId  p_atomId)
inlinevirtual

[AI] Sets the atom id for this object instance, used for indexing or lookup.

Parameters
p_atomIdAtom identifier for string/value pair. [AI]

Reimplemented in MxDSMultiAction.

Definition at line 118 of file mxdsobject.h.

◆ SetObjectId()

void MxDSObject::SetObjectId ( MxU32  p_objectId)
inline

[AI] Sets the object id (for serialization or lookup).

Parameters
p_objectIdValue to use as objectId. [AI]

Definition at line 147 of file mxdsobject.h.

◆ SetObjectName()

void MxDSObject::SetObjectName ( const char *  p_objectName)

[AI] Sets object (internal) unique name; deep copies the string.

Parameters
p_objectNameC-string to set as objectName. [AI]

Definition at line 77 of file mxdsobject.cpp.

◆ SetSourceName()

void MxDSObject::SetSourceName ( const char *  p_sourceName)

[AI] Sets the source name (usually source SI file); deep copies the string.

Parameters
p_sourceNameC-string to set as sourceName. [AI]

Definition at line 99 of file mxdsobject.cpp.

◆ SetType()

void MxDSObject::SetType ( Type  p_type)
inline

[AI] Sets the DS object type.

Parameters
p_typeValue to store as m_type. [AI]

Definition at line 143 of file mxdsobject.h.

◆ SetUnknown24()

void MxDSObject::SetUnknown24 ( MxS16  p_unk0x24)
inline

[AI] Sets the unknown field at 0x24 (possibly version/state).

Parameters
p_unk0x24Value for 0x24. [AI]

Definition at line 151 of file mxdsobject.h.

◆ SetUnknown28()

void MxDSObject::SetUnknown28 ( MxPresenter p_unk0x28)
inline

[AI] Sets the pointer at 0x28 (presenter or handler).

Parameters
p_unk0x28Pointer, usually to a MxPresenter. [AI]

Definition at line 155 of file mxdsobject.h.

◆ VTable0x14()

undefined4 MxDSObject::VTable0x14 ( )
virtual

[AI] Placeholder for early vtable slot (purpose unknown, may be used for RTTI).

[AI]

Returns
Always returns 10. [AI]

Reimplemented in MxDSAction, MxDSMediaAction, and MxDSMultiAction.

Definition at line 121 of file mxdsobject.cpp.

Member Data Documentation

◆ m_atomId

MxAtomId MxDSObject::m_atomId
protected

[AI] String/value pair for engine lookup/reference. [AI]

Definition at line 171 of file mxdsobject.h.

◆ m_objectId

MxU32 MxDSObject::m_objectId
protected

[AI] Numeric id (unique per file or context, often -1). [AI]

Definition at line 170 of file mxdsobject.h.

◆ m_objectName

char* MxDSObject::m_objectName
protected

[AI] Heap copy: Logical object name as referenced in script/data. [AI]

Definition at line 169 of file mxdsobject.h.

◆ m_sizeOnDisk

MxU32 MxDSObject::m_sizeOnDisk
protected

[AI] Cached/calculated disk size of object data for serialization. [AI]

Definition at line 165 of file mxdsobject.h.

◆ m_sourceName

char* MxDSObject::m_sourceName
protected

[AI] Heap copy: SI file or source identifier string. [AI]

Definition at line 167 of file mxdsobject.h.

◆ m_type

MxU16 MxDSObject::m_type
protected

[AI] Object type enum (see Type) as read from data or set in code. [AI]

Definition at line 166 of file mxdsobject.h.

◆ m_unk0x14

undefined4 MxDSObject::m_unk0x14
protected

[AI] Unknown usage, possibly flags or reserved SI-format field. [AI]

Definition at line 168 of file mxdsobject.h.

◆ m_unk0x24

MxS16 MxDSObject::m_unk0x24
protected

[AI] Unknown usage, possibly used for context or flags during loading. [AI]

Definition at line 172 of file mxdsobject.h.

◆ m_unk0x28

MxPresenter* MxDSObject::m_unk0x28
protected

[AI] Presenter or handler associated to this object (may be null). [AI]

Definition at line 173 of file mxdsobject.h.


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