NoJobEngine
2.0.7
Toggle main menu visibility
Loading...
Searching...
No Matches
Entity.h
Go to the documentation of this file.
1
6
#pragma once
7
#include <cstdint>
8
#include <type_traits>
9
10
namespace
NoJob
11
{
12
class
Scene
;
13
class
PrefabSerializer
;
14
15
class
Entity
16
{
17
public
:
18
Entity
() =
default
;
19
Entity
(std::uint32_t handle,
Scene
* scene)
20
: m_Handle(handle), m_Scene(scene)
21
{
22
}
23
24
template
<
typename
T,
typename
... Args>
25
T&
AddComponent
(Args&&... args);
26
27
template
<
typename
T>
28
void
RemoveComponent
();
29
30
template
<
typename
T>
31
T&
GetComponent
();
32
33
template
<
typename
T>
34
const
T&
GetComponent
()
const
;
35
36
template
<
typename
T>
37
bool
HasComponent
()
const
;
38
39
explicit
operator
bool()
const
;
40
41
std::uint32_t
GetHandle
()
const
{
return
m_Handle; }
42
Scene
*
GetScene
()
const
{
return
m_Scene; }
43
44
bool
operator==
(
const
Entity
& other)
const
45
{
46
return
m_Handle == other.m_Handle && m_Scene == other.m_Scene;
47
}
48
49
bool
operator!=
(
const
Entity
& other)
const
50
{
51
return
!(*
this
== other);
52
}
53
54
private
:
55
std::uint32_t m_Handle = 0;
56
Scene
* m_Scene =
nullptr
;
57
58
friend
class
Scene
;
59
friend
class
PrefabSerializer
;
60
};
61
}
NoJob::Entity::Scene
friend class Scene
Definition
Entity.h:58
NoJob::Entity::Entity
Entity()=default
NoJob::Entity::PrefabSerializer
friend class PrefabSerializer
Definition
Entity.h:59
NoJob::Entity::GetHandle
std::uint32_t GetHandle() const
Definition
Entity.h:41
NoJob::Entity::RemoveComponent
void RemoveComponent()
Definition
Scene.h:844
NoJob::Entity::GetComponent
T & GetComponent()
Definition
Scene.h:851
NoJob::Entity::operator==
bool operator==(const Entity &other) const
Definition
Entity.h:44
NoJob::Entity::Entity
Entity(std::uint32_t handle, Scene *scene)
Definition
Entity.h:19
NoJob::Entity::AddComponent
T & AddComponent(Args &&... args)
Definition
Scene.h:836
NoJob::Entity::HasComponent
bool HasComponent() const
Definition
Scene.h:865
NoJob::Entity::operator!=
bool operator!=(const Entity &other) const
Definition
Entity.h:49
NoJob::Entity::GetScene
Scene * GetScene() const
Definition
Entity.h:42
NoJob::PrefabSerializer
Definition
PrefabSerializer.h:12
NoJob::Scene
Definition
Scene.h:31
NoJob
Definition
BTActionNode.h:13
Engine
Scene
Entity.h
Generated by
1.18.0