Isle
|
[AI] Forward declaration for the factory responsible for constructing core objects from atom or type ids. More...
#include <mxobjectfactory.h>
Public Member Functions | |
MxObjectFactory () | |
[AI] Constructs a new MxObjectFactory and initializes atom IDs for all supported presenter classes. More... | |
const char * | ClassName () const override |
[AI] Returns the class name. More... | |
MxBool | IsA (const char *p_name) const override |
[AI] Determines whether this class is or inherits from the named class. More... | |
virtual MxCore * | Create (const char *p_name) |
[AI] Creates a new instance of the class matching the provided string name. More... | |
virtual void | Destroy (MxCore *p_object) |
[AI] Destroys (deletes) a dynamic object created by this factory. More... | |
![]() | |
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... | |
[AI] Forward declaration for the factory responsible for constructing core objects from atom or type ids.
[AI] Factory class for dynamic creation and destruction of presenter and core objects using their string names.
[AI]
[AI] This class is responsible for instantiating objects of several presenter types, identified by string names. It provides a polymorphic interface for creating and destroying objects derived from MxCore, enabling data-driven object management, notably from script or resource file loading. String IDs (as MxAtomId) corresponding to each supported object type are retained for fast lookup. [AI]
The factory manages a set of presenter and media handler objects used throughout the LEGO Island game engine.
Definition at line 34 of file mxobjectfactory.h.
MxObjectFactory::MxObjectFactory | ( | ) |
[AI] Constructs a new MxObjectFactory and initializes atom IDs for all supported presenter classes.
[AI]
[AI] Upon initialization, string/class name mappings are built as MxAtomId members for fast lookup in Create. [AI]
Definition at line 20 of file mxobjectfactory.cpp.
|
inlineoverridevirtual |
[AI] Returns the class name.
[AI]
Reimplemented from MxCore.
Definition at line 42 of file mxobjectfactory.h.
|
virtual |
[AI] Creates a new instance of the class matching the provided string name.
[AI]
p_name | Null-terminated name of the class to instantiate. Must match one of the supported presenter types. [AI] |
[AI] Returns a pointer to the newly created object derived from MxCore, or NULL if the class is unknown. [AI]
Reimplemented in LegoObjectFactory.
Definition at line 29 of file mxobjectfactory.cpp.
|
virtual |
[AI] Destroys (deletes) a dynamic object created by this factory.
[AI]
p_object | Pointer to the object (MxCore-derived) to destroy. [AI] |
[AI] Assumes the pointer was obtained from Create and is safe to delete (uses delete operator). [AI]
Reimplemented in LegoObjectFactory.
Definition at line 48 of file mxobjectfactory.cpp.
|
inlineoverridevirtual |
[AI] Determines whether this class is or inherits from the named class.
[AI]
p_name | Name of class to check against (case sensitive). [AI] |
[AI] Checks if p_name matches "MxObjectFactory" or its ancestor MxCore's name. [AI]
Reimplemented from MxCore.
Definition at line 50 of file mxobjectfactory.h.