Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::owned_component Class Reference

Component that is owned by an entity. More...

#include <basic_component.h>

Inheritance diagram for unravel::owned_component:
unravel::basic_component unravel::component_crtp< model_component, owned_component > unravel::component_crtp< physics_component, owned_component > unravel::component_crtp< prefab_component, owned_component > unravel::component_crtp< script_component, owned_component > unravel::component_crtp< transform_component, owned_component > unravel::component_crtp< ui_document_component, owned_component > unravel::model_component unravel::physics_component unravel::prefab_component unravel::script_component unravel::transform_component unravel::ui_document_component

Public Member Functions

auto operator= (const owned_component &other) -> owned_component &=default
 
void set_owner (entt::handle owner)
 Sets the owner of the component.
 
auto get_owner () const noexcept -> entt::const_handle
 Gets the owner of the component.
 
auto get_owner () noexcept -> entt::handle
 Gets the owner of the component.
 
- Public Member Functions inherited from unravel::basic_component
void touch ()
 Marks the component as 'touched'.
 

Static Public Member Functions

template<typename T >
static void on_create_component (entt::registry &r, entt::entity e)
 
template<typename T >
static void on_destroy_component (entt::registry &r, entt::entity e)
 

Additional Inherited Members

- Public Attributes inherited from unravel::basic_component
bool eto {}
 Disable empty type optimizations.
 

Detailed Description

Component that is owned by an entity.

Definition at line 31 of file basic_component.h.

Member Function Documentation

◆ get_owner() [1/2]

auto unravel::owned_component::get_owner ( ) const -> entt::const_handle
inlinenodiscardnoexcept

Gets the owner of the component.

Returns
A constant handle to the owner entity.

Definition at line 64 of file basic_component.h.

◆ get_owner() [2/2]

auto unravel::owned_component::get_owner ( ) -> entt::handle
inlinenodiscardnoexcept

Gets the owner of the component.

Returns
A handle to the owner entity.

Definition at line 73 of file basic_component.h.

◆ on_create_component()

template<typename T >
static void unravel::owned_component::on_create_component ( entt::registry & r,
entt::entity e )
inlinestatic

Definition at line 36 of file basic_component.h.

◆ on_destroy_component()

template<typename T >
static void unravel::owned_component::on_destroy_component ( entt::registry & r,
entt::entity e )
inlinestatic

Definition at line 45 of file basic_component.h.

◆ operator=()

auto unravel::owned_component::operator= ( const owned_component & other) -> owned_component &=default
default

◆ set_owner()

void unravel::owned_component::set_owner ( entt::handle owner)
inline

Sets the owner of the component.

Parameters
ownerThe entity handle representing the owner.

Definition at line 55 of file basic_component.h.


The documentation for this class was generated from the following file: