|
Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
|
This is the base class for components. NOTE: only the Entity class is allowed to create this object. More...
#include <Component.hpp>
Public Member Functions | |
| virtual | ~Component ()=default |
| eastl::weak_ptr< Entity > | GetOwner () const |
| This method allows you to get the entity holding this component. More... | |
Public Attributes | |
| bool | isEnabled |
Protected Member Functions | |
| Component () | |
| virtual void | InitializeComponent () |
| This method is used to initialize your component in. This method is called after the setting of the owner. More... | |
| virtual void | Update () |
| The update method of this component. NOTE: This method will not be called in case the entity is disabled. More... | |
| virtual void | OnComponentAdded (eastl::weak_ptr< Component > addedComponent) |
| This method will be called whenever a component has been added to the entity. More... | |
| virtual void | OnComponentRemoved (eastl::weak_ptr< Component > removedComponent) |
| This method will be called whenever a component has been removed from the entity. More... | |
| template<typename ComponentType > | |
| eastl::weak_ptr< ComponentType > | GetComponent () |
| This method allows you to get the first component of the given type. More... | |
| template<typename ComponentType > | |
| eastl::vector< eastl::weak_ptr< ComponentType > > | GetComponents () |
| This method allows you to get all of the components of the given type. More... | |
| eastl::vector< eastl::shared_ptr< Component > > | GetAllComponents () const |
| Returns all the components of this entity. More... | |
| template<class ComponentType , class... Args> | |
| eastl::weak_ptr< ComponentType > | AddComponent (Args &&...args) |
| Allows you to create a component of the given type. More... | |
| template<class ComponentType , class... Args> | |
| eastl::vector< eastl::weak_ptr< ComponentType > > | AddComponents (size_t count, Args &&...args) |
| Allows you to create X amount of components of the given type. More... | |
| template<typename ComponentType > | |
| void | RemoveComponent (size_t amountToRemove=1) const |
| Allows X amount of components of the given type. More... | |
| template<typename ComponentType > | |
| void | RemoveAllComponents () const |
| Deletes all the components of the given type. More... | |
| template<typename archive > | |
| void | SaveBaseComponent (archive ar) |
| Saves the data of this component to a archive (all derived classes have their own version, but if needed they can call this one as a failsafe/default version) More... | |
| template<typename archive > | |
| void | LoadBaseComponent (archive ar) |
| loads the data from the archive to this component (all derived classes have their own version, but if needed they can call this one as a failsafe/default version) More... | |
| virtual void | OnBeginContact (eastl::weak_ptr< Entity > entity) |
| virtual void | OnEndContact (eastl::weak_ptr< Entity > entity) |
| eastl::weak_ptr< Component > | GetPointerRefence () const |
| This method allows you to get a direct refence to the weak pointer of this component. More... | |
| template<typename ComponentType > | |
| eastl::weak_ptr< ComponentType > | GetPointerRefence () |
| This method allows you to get a direct refence to the weak pointer of this component. More... | |
Friends | |
| class | Entity |
This is the base class for components. NOTE: only the Entity class is allowed to create this object.
Definition at line 16 of file Component.hpp.
|
virtualdefault |
|
explicitprotected |
Definition at line 14 of file Component.cpp.
|
protected |
Allows you to create a component of the given type.
| ...args | The arguments required to initialize the component. |
Definition at line 163 of file Component.hpp.
|
protected |
Allows you to create X amount of components of the given type.
| count | The amount of components you want to add of this given type. |
| ...args | The arguments required to initialize the components. |
Definition at line 169 of file Component.hpp.
|
protected |
Returns all the components of this entity.
Definition at line 34 of file Component.cpp.
|
protected |
This method allows you to get the first component of the given type.
Definition at line 151 of file Component.hpp.
|
protected |
This method allows you to get all of the components of the given type.
Definition at line 157 of file Component.hpp.
| eastl::weak_ptr< Entity > Engine::Component::GetOwner | ( | ) | const |
This method allows you to get the entity holding this component.
Definition at line 9 of file Component.cpp.
|
protected |
This method allows you to get a direct refence to the weak pointer of this component.
Definition at line 47 of file Component.cpp.
|
protected |
This method allows you to get a direct refence to the weak pointer of this component.
Definition at line 187 of file Component.hpp.
|
protectedvirtual |
This method is used to initialize your component in. This method is called after the setting of the owner.
Definition at line 18 of file Component.cpp.
|
protected |
loads the data from the archive to this component (all derived classes have their own version, but if needed they can call this one as a failsafe/default version)
| ar | the archive that you want to load from |
Definition at line 69 of file Component.cpp.
|
protectedvirtual |
Definition at line 39 of file Component.cpp.
|
protectedvirtual |
This method will be called whenever a component has been added to the entity.
| addedComponent | The component that has been added. |
Definition at line 26 of file Component.cpp.
|
protectedvirtual |
This method will be called whenever a component has been removed from the entity.
| removedComponent | The component that has been removed. |
Definition at line 30 of file Component.cpp.
|
protectedvirtual |
Definition at line 43 of file Component.cpp.
|
protected |
Deletes all the components of the given type.
Definition at line 181 of file Component.hpp.
|
protected |
Allows X amount of components of the given type.
| amountToRemove | Will remove 1 component by default, can be change optionally. |
Definition at line 175 of file Component.hpp.
|
protected |
Saves the data of this component to a archive (all derived classes have their own version, but if needed they can call this one as a failsafe/default version)
| ar | the archive that you want to save to |
Definition at line 63 of file Component.cpp.
|
protectedvirtual |
The update method of this component. NOTE: This method will not be called in case the entity is disabled.
Reimplemented in Engine::TransformComponent.
Definition at line 22 of file Component.cpp.
|
friend |
Definition at line 29 of file Component.hpp.
| bool Engine::Component::isEnabled |
Definition at line 26 of file Component.hpp.
1.8.11