![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <ObjectFactory.h>
Inheritance diagram for ObjectFactory:
Collaboration diagram for ObjectFactory:Public Types | |
| using | CreatorFunction = std::function< Object *()> |
Public Member Functions | |
| ObjectFactory () | |
| virtual | ~ObjectFactory () |
| virtual ObjectType | GetObjectType () const |
| bool | Register (const std::string &className, CreatorFunction creator) |
| Enregistre une fonction de cr�ation pour un nom de classe donn�. | |
| bool | IsRegistered (const std::string &className) const |
| Object * | CreateObject (const std::string &className) |
| Cr�e une nouvelle instance de l'objet sp�cifi� par son nom de classe. | |
| ObjectComponent * | AddComponent (const std::string &className, Object *owner) |
| virtual void | OnEvent (const Message &msg) override |
Public Member Functions inherited from Object | |
| Object () | |
| virtual | ~Object () |
| virtual void | Process () |
| virtual void | Render () |
| uint64_t | GetUID () const |
Static Public Member Functions | |
| static ObjectFactory & | GetInstance () |
| static ObjectFactory & | Get () |
Public Attributes | |
| std::map< std::string, CreatorFunction > | m_registeredCreators |
Public Attributes inherited from Object | |
| std::string | name = "unnamed_object" |
Private Member Functions | |
| Object * | FindObjectByUID (uint64_t uid) |
Static Private Member Functions | |
| static std::vector< Object * > & | GetWorldObjectList () |
Additional Inherited Members | |
Protected Attributes inherited from Object | |
| uint64_t | uid = 0 |
Definition at line 25 of file ObjectFactory.h.
| using ObjectFactory::CreatorFunction = std::function<Object* ()> |
Definition at line 28 of file ObjectFactory.h.
|
inline |
Definition at line 31 of file ObjectFactory.h.
References EventManager::Get(), Olympe_EventType_Object_Create, Olympe_EventType_Object_Destroy, Olympe_EventType_Property_Add, Olympe_EventType_Property_Remove, EventManager::Register(), and SYSTEM_LOG.
Here is the call graph for this function:
|
inlinevirtual |
Definition at line 41 of file ObjectFactory.h.
References EventManager::Get(), Olympe_EventType_Object_Create, Olympe_EventType_Object_Destroy, Olympe_EventType_Property_Add, Olympe_EventType_Property_Remove, SYSTEM_LOG, and EventManager::Unregister().
Here is the call graph for this function:
|
inline |
Definition at line 108 of file ObjectFactory.h.
References World::Get(), GetComponentTypeID_Static(), m_registeredCreators, ObjectComponent::SetOwner(), and SYSTEM_LOG.
Referenced by Npc::Create(), and Player::Create().
Here is the call graph for this function:
Here is the caller graph for this function:Cr�e une nouvelle instance de l'objet sp�cifi� par son nom de classe.
| className | Le nom de la classe � cr�er. |
Definition at line 95 of file ObjectFactory.h.
References World::Get(), GetComponentTypeID_Static(), m_registeredCreators, and SYSTEM_LOG.
Here is the call graph for this function:Definition at line 202 of file ObjectFactory.h.
References GetComponentTypeID_Static(), GetWorldObjectList(), and Object::uid.
Here is the call graph for this function:
|
inlinestatic |
Definition at line 58 of file ObjectFactory.h.
References GetInstance().
Referenced by Npc::Create(), and Player::Create().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 53 of file ObjectFactory.h.
References GetComponentTypeID_Static().
Referenced by AutoRegister< T >::AutoRegister(), and Get().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinevirtual |
Definition at line 50 of file ObjectFactory.h.
References Singleton.
Definition at line 211 of file ObjectFactory.h.
References World::Get().
Referenced by FindObjectByUID(), and OnEvent().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 85 of file ObjectFactory.h.
References GetComponentTypeID_Static(), and m_registeredCreators.
Here is the call graph for this function:Reimplemented from Object.
Definition at line 127 of file ObjectFactory.h.
References GetComponentTypeID_Static(), GetWorldObjectList(), Olympe_EventType_Object_Create, Olympe_EventType_Object_Destroy, Olympe_EventType_Property_Add, Olympe_EventType_Property_Remove, SYSTEM_LOG, and Object::uid.
Here is the call graph for this function:
|
inline |
Enregistre une fonction de cr�ation pour un nom de classe donn�.
| className | Le nom de la classe (cl�). |
| creator | La fonction de cr�ation (std::function retournant BaseObject*). |
Definition at line 66 of file ObjectFactory.h.
References GetComponentTypeID_Static(), m_registeredCreators, and SYSTEM_LOG.
Referenced by AutoRegister< T >::AutoRegister().
Here is the call graph for this function:
Here is the caller graph for this function:| std::map<std::string, CreatorFunction> ObjectFactory::m_registeredCreators |
Definition at line 29 of file ObjectFactory.h.
Referenced by AddComponent(), CreateObject(), IsRegistered(), and Register().