turbo::Component Class Reference
Components who defines the behaviour of a GameObject. More...
#include <Component.hpp>


Public Member Functions | |
Component (GameObject *parent) | |
Construct a new Component. The component will be automatically added to the GameObject given as parameter. More... | |
virtual void | load () |
Called when the component is loaded into the scene. | |
virtual void | on_disable () |
Called when the component is disabled. | |
virtual void | on_enable () |
Called when the component is enabled (Not called on the first initialization) | |
virtual void | update (int delta_time) |
Logic update. Souldn't be used for anything else than logic. More... | |
virtual void | unload () |
Called when the component is unloaded. | |
void | disable () |
Disable the component. Do nothing if already disabled. | |
void | enable () |
Enable the component. Do nothing if already enabled. | |
bool | is_enabled () |
Check if the component is enabled. More... | |
const char * | get_name () const |
Public Attributes | |
::std::vector< debug::InspectorObserver * > | debug_inspector_observers {} |
Debug use only. List of observed values in the inspector. | |
Protected Attributes | |
GameObject * | gameObject = nullptr |
bool | enabled = true |
const char * | name = "Unknown" |
Detailed Description
Components who defines the behaviour of a GameObject.
Constructor & Destructor Documentation
◆ Component()
|
explicit |
Construct a new Component. The component will be automatically added to the GameObject given as parameter.
- Parameters
-
parent GameObject that holds the component
Member Function Documentation
◆ is_enabled()
bool turbo::Component::is_enabled | ( | ) |
Check if the component is enabled.
- Returns
- true if enabled
◆ update()
|
inlinevirtual |
Logic update. Souldn't be used for anything else than logic.
- Parameters
-
delta_time milliseconds since the last call
Reimplemented in turbo::component::SimpleControl.
The documentation for this class was generated from the following files:
- include/turbo/Component.hpp
- src/Component.cpp