#include <scene_object.h>
Appliaction scene object class.
Definition at line 18 of file scene_object.h.
◆ scene_object() [1/2]
scl::scene_object::scene_object |
( |
| ) |
|
|
default |
Scene object default constructor.
◆ scene_object() [2/2]
scl::scene_object::scene_object |
( |
const scene_object & |
Other | ) |
|
|
default |
Scene object default copy constructor.
◆ ~scene_object()
scl::scene_object::~scene_object |
( |
| ) |
|
|
default |
scene object default destructor.
◆ AddComponent()
template<typename T , typename... Targs>
decltype(auto) scl::scene_object::AddComponent |
( |
Targs &&... |
Args | ) |
|
|
inline |
- Add component to object function.
- Template Parameters
-
component | to add to object. |
- Parameters
-
- Returns
- None.
Definition at line 84 of file scene_object.h.
85 {
86 return Scene->Registry.emplace<
T>(Entity, std::forward<Targs>(Args)...);
87 }
◆ GetComponent() [1/2]
template<typename T >
T & scl::scene_object::GetComponent |
( |
| ) |
|
|
inline |
- Get object component function.
- Template Parameters
-
component | to get from object. |
- Parameters
-
- Returns
- None.
Definition at line 97 of file scene_object.h.
98 {
99 SCL_CORE_ASSERT(HasComponent<T>(),
"Scene object don't have \"{}\" component!",
typeid(T).name());
100 return Scene->Registry.get<
T>(Entity);
101 }
#define SCL_CORE_ASSERT(expr,...)
◆ GetComponent() [2/2]
template<typename T >
const T & scl::scene_object::GetComponent |
( |
| ) |
const |
|
inline |
- Gect object component function.
- Template Parameters
-
component | to get from object. |
- Parameters
-
- Returns
- None.
Definition at line 111 of file scene_object.h.
112 {
113 SCL_CORE_ASSERT(HasComponent<T>(),
"Scene object don't have \"{}\" component!",
typeid(T).name());
114 return Scene->Registry.get<
T>(Entity);
115 }
◆ GetHandle()
- Scene object inner scene_object_handle getter function.
- Parameters
-
- Returns
- object inner scene_object_handle.
Definition at line 53 of file scene_object.h.
◆ HasComponent()
template<typename T >
const bool scl::scene_object::HasComponent |
( |
| ) |
const |
|
inline |
- Check if object has specified component function.
- Template Parameters
-
- Parameters
-
- Returns
- None.
Definition at line 71 of file scene_object.h.
72 {
73 return Scene->Registry.all_of<
T>(Entity);
74 }
◆ IsOk()
bool scl::scene_object::IsOk |
( |
| ) |
const |
|
inline |
- Check if scene object is valid function.
- Parameters
-
- Returns
- wheather object is valid or not.
Definition at line 61 of file scene_object.h.
61{ return Scene && Scene->Registry.valid(Entity); }
◆ operator bool()
scl::scene_object::operator bool |
( |
| ) |
const |
|
inline |
- Check if scene object exists function.
- Parameters
-
- Returns
- wheather scene object exists or not.
Definition at line 136 of file scene_object.h.
136{ return Entity != entt::null; }
◆ operator scene_object_handle()
- Getting scene object inner scene_object_handle.
- Parameters
-
- Returns
- inner object scene_object_handle.
Definition at line 152 of file scene_object.h.
◆ operator u32()
scl::scene_object::operator u32 |
( |
| ) |
const |
|
inline |
- Getting scene object inner scene_object_handle.
- Parameters
-
- Returns
- inner object scene_object_handle.
Definition at line 144 of file scene_object.h.
144{
return (
u32)Entity; }
◆ operator!=()
bool scl::scene_object::operator!= |
( |
const scene_object & |
Other | ) |
const |
|
inline |
- Scene objects compare function.
- Parameters
-
Other | - scene object to compare with. |
- Returns
- wheather scene objects are the same or not.
Definition at line 171 of file scene_object.h.
172 {
173 return Entity != Other.Entity || Scene != Other.Scene;
174 }
◆ operator==()
bool scl::scene_object::operator== |
( |
const scene_object & |
Other | ) |
const |
|
inline |
- Scene objects compare function.
- Parameters
-
Other | - scene object to compare with. |
- Returns
- wheather scene objects are the same or not.
Definition at line 160 of file scene_object.h.
161 {
162 return Entity == Other.Entity && Scene == Other.Scene;
163 }
◆ RemovetComponent()
template<typename T >
void scl::scene_object::RemovetComponent |
( |
| ) |
|
|
inline |
- Remove component from scene object function.
- Template Parameters
-
component | to remove from object. |
- Parameters
-
- Returns
- None.
Definition at line 125 of file scene_object.h.
126 {
127 Scene->Registry.remove<
T>(Entity);
128 }
◆ scene
◆ scene_hierarchy_window
The documentation for this class was generated from the following file: