My Project
Entity.hpp
1 /*
2 ** EPITECH PROJECT, 2022
3 ** r-type
4 ** File description:
5 ** Entity
6 */
7 
8 #ifndef ENTITY_HPP_
9  #define ENTITY_HPP_
10 
11  #include <iostream>
12 
16 class Entity {
17  public:
23  explicit Entity(std::size_t id) : _id(id) {
24  };
25 
29  ~Entity() = default;
30 
36  operator std::size_t() const {
37  return _id;
38  };
39 
40  protected:
41  friend class Registry;
42 
43  private:
44  std::size_t _id;
45 };
46 
47 #endif /* !ENTITY_HPP_ */
Registry
Class that handle ECS.
Definition: Registry.hpp:22
Entity
Class that handle entity in a sparse array like an index.
Definition: Entity.hpp:16
Entity::~Entity
~Entity()=default
Destroy the Entity object.
Entity::Entity
Entity(std::size_t id)
Construct a new Entity object.
Definition: Entity.hpp:23