|
| virtual | ~EntityScript ()=default |
| |
| virtual void | onCreate () |
| | A function called by the runtime whenever the script is first created.
|
| |
| virtual void | update (double dt) |
| | A function called by the runtime every update iteration.
|
| |
| virtual void | onDestroy () |
| | A function called by the runtime whenever the script is destroyed.
|
| |
| template<CComponent C, typename... Args> |
| C & | add (Args &&... args) noexcept(std::is_nothrow_constructible_v< C, Args... >) |
| | Adds a new component.
|
| |
| template<CComponent C, typename Block , typename... Args> |
| C & | addWith (Block &&block, Args &&... args) noexcept(std::is_nothrow_constructible_v< C, Args... >) |
| | Adds a new component and calls block with the added component.
|
| |
| template<CComponent C, typename... Args> |
| C & | set (Args &&... args) noexcept(std::is_nothrow_constructible_v< C, Args... >) |
| | Sets a component.
|
| |
| template<CComponent C> |
| void | remove () noexcept(std::is_nothrow_destructible_v< C >) |
| | Removes a component of type C from the entity.
|
| |
| template<CComponent C> |
| C & | get () noexcept |
| | Gets a component of type C.
|
| |
| template<CComponent C> |
| const C & | get () const noexcept |
| | Gets a component of type C.
|
| |
| template<CComponent C0, CComponent C1, CComponent... Cs> |
| Tuple< C0 &, C1 &, Cs &... > | get () noexcept |
| | Gets a set of components of types C0, C1 and Cs.
|
| |
| template<CComponent C0, CComponent C1, CComponent... Cs> |
| Tuple< const C0 &, const C1 &, const Cs &... > | get () const noexcept |
| | Gets a set of components of types C0, C1 and Cs.
|
| |
| template<CComponent C> |
| C & | getOr () noexcept(std::is_nothrow_constructible_v< C >) |
| | Gets a component of type C.
|
| |
| template<CComponent C0, CComponent C1, CComponent... Cs> |
| Tuple< C0 &, C1 &, Cs &... > | getOr () noexcept |
| | Gets a set of components of types C0, C1 and Cs.
|
| |
| template<CComponent C> |
| C * | getIf () noexcept |
| | Gets a component of type C.
|
| |
| template<CComponent C> |
| const C * | getIf () const noexcept |
| | Gets a component of type C.
|
| |
| template<CComponent C0, CComponent C1, CComponent... Cs> |
| Tuple< C0 *, C1 *, Cs *... > | getIf () noexcept |
| | Gets a set of components of types C0, C1 and Cs.
|
| |
| template<CComponent C0, CComponent C1, CComponent... Cs> |
| Tuple< const C0 *, const C1 *, const Cs *... > | getIf () const noexcept |
| | Gets a set of components of types C0, C1 and Cs.
|
| |
| template<CComponent C, CComponent... Cs> |
| bool | has () const noexcept |
| | Checks if the entity has all components of types Cs.
|
| |
template<CComponent C0, CComponent C1, CComponent... Cs>
Gets a set of components of types C0, C1 and Cs.
If any of the components are not present, this method throws.
- Template Parameters
-
| C0 | The type of the first component to be retrieved |
| C1 | The type of the second component to be retrieved |
| Cs | The remaining types of the components to be retrieved |
- Returns
- A reference to the existing components
template<CComponent C0, CComponent C1, CComponent... Cs>
| Tuple< C0 &, C1 &, Cs &... > CeresEngine::EntityScript::get |
( |
| ) |
|
|
inlinenoexcept |
Gets a set of components of types C0, C1 and Cs.
If any of the components are not present, this method throws.
- Template Parameters
-
| C0 | The type of the first component to be retrieved |
| C1 | The type of the second component to be retrieved |
| Cs | The remaining types of the components to be retrieved |
- Returns
- A reference to the existing component
template<CComponent C0, CComponent C1, CComponent... Cs>
Gets a set of components of types C0, C1 and Cs.
If any of the components are not present, nullptr is returned.
- Template Parameters
-
| C0 | The type of the first component to be retrieved |
| C1 | The type of the second component to be retrieved |
| Cs | The remaining types of the components to be retrieved |
- Returns
- A reference to the existing components
template<CComponent C0, CComponent C1, CComponent... Cs>
| Tuple< C0 *, C1 *, Cs *... > CeresEngine::EntityScript::getIf |
( |
| ) |
|
|
inlinenoexcept |
Gets a set of components of types C0, C1 and Cs.
If any of the components are not present, nullptr is returned.
- Template Parameters
-
| C0 | The type of the first component to be retrieved |
| C1 | The type of the second component to be retrieved |
| Cs | The remaining types of the components to be retrieved |
- Returns
- A reference to the existing components
template<CComponent C0, CComponent C1, CComponent... Cs>
| Tuple< C0 &, C1 &, Cs &... > CeresEngine::EntityScript::getOr |
( |
| ) |
|
|
inlinenoexcept |
Gets a set of components of types C0, C1 and Cs.
If any of the components are not present, a new component is created.
- Template Parameters
-
| C0 | The type of the first component to be retrieved |
| C1 | The type of the second component to be retrieved |
| Cs | The remaining types of the components to be retrieved |
- Returns
- A reference to the existing components