|
HatchitGame
|
Public Member Functions | |
| GameObject (const GameObject &rhs)=default | |
| GameObject (GameObject &&rhs)=default | |
| GameObject & | operator= (const GameObject &rhs)=default |
| GameObject & | operator= (GameObject &&rhs)=default |
| const Core::Guid & | GetGuid (void) const |
| Retrieve this GameObject's Guid. | |
| const std::string & | GetName (void) const |
| Retrieve this GameObject's name. | |
| Transform & | GetTransform (void) |
| Retrieve this GameObject's Transform. | |
| bool | GetEnabled (void) const |
| Indicates whether or not this GameObject is enabled. More... | |
| void | SetEnabled (bool value) |
| Enables/Disables the GameObject based on the provided value. More... | |
| void | Enable (void) |
| An inline for SetEnabled(true);. | |
| void | Disable (void) |
| An inline for SetEnabled(false);. | |
| GameObject * | GetParent (void) |
| Returns this GameObject's parent. More... | |
| void | SetParent (GameObject *parent) |
| Sets the parent of this GameObject. More... | |
| GameObject * | GetChildAtIndex (std::size_t index) |
| Returns a child GameObject located at the provided index. More... | |
| void | AddChild (GameObject *child) |
| Adds the provided GameObject as a child of this GameObject. More... | |
| void | RemoveChildAtIndex (std::size_t index) |
| Attempts to remove the GameObject child at the provided index. More... | |
| void | RemoveChild (GameObject *child) |
| Attempts to remove provided GameObject from this GameObject. More... | |
| void | OnInit (void) |
| Called when the gameobject is created to initialize all values. | |
| void | Update (void) |
| Called once per frame while the gameobject is enabled. More... | |
| void | MarkForDestroy (void) |
| Marks the GameObject to be destroyed the next time it would be updated. More... | |
| template<typename T > | |
| bool | AddComponent (T *component) |
| Attempts to attach a Component of type T. More... | |
| template<typename T , typename... Args> | |
| bool | AddComponent (Args &&...args) |
| Attempts to attach a Component of type T. More... | |
| template<typename T > | |
| bool | RemoveComponent (void) |
| Attempts to remove a Component of type T. More... | |
| template<typename T > | |
| bool | HasComponent (void) const |
| Test if a Component of type T is attached to this GameObject. More... | |
| template<typename T1 , typename T2 , typename... Args> | |
| bool | HasComponent (void) const |
| Test if Components of types T1, T2, and Args... More... | |
| template<typename T > | |
| T * | GetComponent (void) |
| Return a Component of type T attached to this GameObject. More... | |
| template<typename... Args> | |
| std::tuple< Args *... > | GetComponents (void) |
| Returns Components of type Args... More... | |
| template<typename T > | |
| bool | EnableComponent (void) |
| Enable a Component of type T attached to this GameObject. More... | |
| template<typename... Args> | |
| auto | EnableComponents (void) -> decltype(std::make_tuple(EnableComponent< Args >()...)) |
| Enable Components of type Args... More... | |
| template<typename T > | |
| bool | DisableComponent (void) |
| Disable a Component of type T attached to this GameObject. More... | |
| template<typename... Args> | |
| auto | DisableComponents (void) -> decltype(std::make_tuple(DisableComponent< Args >()...)) |
| Disable Components of type Args... More... | |
| template<> | |
| bool | AddComponent (Component *component) |
Friends | |
| class | Scene |
| void GameObject::AddChild | ( | GameObject * | child | ) |
Adds the provided GameObject as a child of this GameObject.
| child | The GameObject to child. |
| bool GameObject::AddComponent | ( | T * | component | ) |
Attempts to attach a Component of type T.
| component | The new Component of type T to attach. |
| T | A sub-class of Component. |
If the component can be attached, its VOnInit and VOnEnabled will be invoked.
| bool GameObject::AddComponent | ( | Args &&... | args | ) |
Attempts to attach a Component of type T.
| args | The arguments to pass to the constructor for T. |
| T | A sub-class of Component. |
| Args... | The arguments to provide to T's constructor. |
This method constructs the Component of type T using the provided args. If the Component can be attached, its VOnInit and VOnEnabled will be invoked.
| bool GameObject::DisableComponent | ( | void | ) |
Disable a Component of type T attached to this GameObject.
| T | A sub-class of Component. |
|
inline |
Disable Components of type Args...
attached to this GameObject.
| Args... | Sub-classes of Component. |
| bool GameObject::EnableComponent | ( | void | ) |
Enable a Component of type T attached to this GameObject.
| T | A sub-class of Component. |
|
inline |
Enable Components of type Args...
attached to this GameObject.
| Args... | Sub-classes of Component. |
| GameObject * GameObject::GetChildAtIndex | ( | std::size_t | index | ) |
Returns a child GameObject located at the provided index.
| index | The index of the particular GameObject to locate. |
| T * GameObject::GetComponent | ( | void | ) |
Return a Component of type T attached to this GameObject.
| T | A sub-class of Component. |
| std::tuple< Args *... > GameObject::GetComponents | ( | void | ) |
Returns Components of type Args...
attached to this GameObject.
| Args... | Sub-classes of Component. |
| bool GameObject::GetEnabled | ( | void | ) | const |
Indicates whether or not this GameObject is enabled.
| GameObject * GameObject::GetParent | ( | void | ) |
Returns this GameObject's parent.
| bool GameObject::HasComponent | ( | void | ) | const |
Test if a Component of type T is attached to this GameObject.
| T | A sub-class of Component. |
| bool GameObject::HasComponent | ( | void | ) | const |
Test if Components of types T1, T2, and Args...
are attached to this GameObject.
| T1 | A sub-class of Component. |
| T2 | A sub-class of Component. |
| Args... | Sub-classes of Component. |
| void GameObject::MarkForDestroy | ( | void | ) |
Marks the GameObject to be destroyed the next time it would be updated.
this also calls VOnDestroy, as the GameObject is to be treated as if it doesn't exist after this point
| void GameObject::RemoveChild | ( | GameObject * | child | ) |
Attempts to remove provided GameObject from this GameObject.
| child | The GameObject to remove. |
| void GameObject::RemoveChildAtIndex | ( | std::size_t | index | ) |
Attempts to remove the GameObject child at the provided index.
| index | The index of the GameObject to remove. |
| bool GameObject::RemoveComponent | ( | void | ) |
| void GameObject::SetEnabled | ( | bool | value | ) |
Enables/Disables the GameObject based on the provided value.
| value | The new value of m_enabled. |
| void GameObject::SetParent | ( | GameObject * | parent | ) |
Sets the parent of this GameObject.
| parent | The new GameObject parent pointer. |
| void GameObject::Update | ( | void | ) |
Called once per frame while the gameobject is enabled.
Updates all components first, then all child gameobjects.
1.8.11