Unravel Engine C++ Reference
Loading...
Searching...
No Matches
id_component.h
Go to the documentation of this file.
1
#pragma once
2
#include <engine/engine_export.h>
3
4
#include <string>
5
#include <
uuid/uuid.h
>
6
7
namespace
unravel
8
{
9
14
struct
id_component
15
{
16
void
regenerate_id
()
17
{
18
id
=
generate_uuid
();
19
}
20
21
void
generate_if_nil
()
22
{
23
if
(
id
.is_nil())
24
{
25
id
=
generate_uuid
();
26
}
27
}
31
hpp::uuid
id
;
32
};
33
34
}
// namespace unravel
unravel
Definition
crash.cpp:21
unravel::generate_uuid
auto generate_uuid() -> hpp::uuid
Definition
uuid.cpp:25
unravel::id_component
Component that provides a unique identifier (UUID) for an entity.
Definition
id_component.h:15
unravel::id_component::id
hpp::uuid id
The unique identifier for the entity.
Definition
id_component.h:31
unravel::id_component::generate_if_nil
void generate_if_nil()
Definition
id_component.h:21
unravel::id_component::regenerate_id
void regenerate_id()
Definition
id_component.h:16
uuid.h
UnravelEngine
UnravelEngine
engine
engine
ecs
components
id_component.h
Generated by
1.12.0