Uranus  1.0.1.0
Uranus is a GameEngine written in C++
Loading...
Searching...
No Matches
Entity.hpp
1/*
2** EPITECH PROJECT, 2023
3** Components.hpp
4** File description:
5** Components.hpp
6*/
7
8#ifndef URANUS_ENTITY_HPP
9#define URANUS_ENTITY_HPP
10
11#include <cstddef>
12
13namespace uranus::ecs {
14
15 class Registry;
16
20 class Entity {
21 friend class Registry;
22
23 public:
27 ~Entity() = default;
28
33 inline operator std::size_t() const { return _id; };
34
39 inline operator std::size_t&() { return _id; }
40
41 private:
45 explicit Entity(size_t id) : _id(id) {}
46
47 size_t _id;
48 };
49} // namespace uranus::ecs
50
51#endif // URANUS_ENTITY_HPP
Entity class, used to identify entities.
Definition: Entity.hpp:20
size_t _id
Id of the entity.
Definition: Entity.hpp:47
Entity(size_t id)
Constructor of the Entity class.
Definition: Entity.hpp:45
~Entity()=default
Default destructor.
Registry class, used to store and manage entities and their components.
Definition: Registry.hpp:24