R-TYPE
Entity.hpp
Go to the documentation of this file.
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 #include <utility>
13 
14 #define MAX_ENTITY 2000
15 
16 namespace ECS {
28  ERROR = -1 };
29 
30 class Entity {
31 public:
32  Entity(std::size_t id, EntityType type);
34  ~Entity() = default;
35 
36  Entity(Entity const&) = default;
37  Entity(Entity&&) noexcept = default;
38 
39  Entity& operator=(Entity const&) = default;
40  Entity& operator=(Entity&&) noexcept = default;
41 
42  std::size_t getId() const;
43  EntityType getType() const;
44 
45 private:
46  std::size_t _id;
47  EntityType _type;
48 };
49 inline bool operator==(const ECS::Entity& cur, const ECS::Entity& oth) { return cur.getId() == oth.getId(); }
50 inline bool operator>(const ECS::Entity& cur, const ECS::Entity& oth) { return cur.getId() > oth.getId(); }
51 inline bool operator<(const ECS::Entity& cur, const ECS::Entity& oth) { return cur.getId() < oth.getId(); }
52 } // namespace ECS
53 
54 #endif /* !ENTITY_HPP_ */
Definition: Entity.hpp:30
Entity(std::size_t id, EntityType type)
Definition: Entity.cpp:16
EntityType getType() const
Definition: Entity.cpp:41
Entity(Entity &&) noexcept=default
~Entity()=default
Entity(Entity const &)=default
std::size_t getId() const
Definition: Entity.cpp:34
Definition: ComponentManager.hpp:14
bool operator<(const ECS::Entity &cur, const ECS::Entity &oth)
Definition: Entity.hpp:51
EntityType
Definition: Entity.hpp:17
@ BONUSENTITY
Definition: Entity.hpp:27
@ BUTTONS
Definition: Entity.hpp:22
@ ENEMY
Definition: Entity.hpp:18
@ PLAYER
Definition: Entity.hpp:17
@ OBSTACLES
Definition: Entity.hpp:20
@ PROJECTILES
Definition: Entity.hpp:19
@ GRAPHICS
Definition: Entity.hpp:21
@ MENUCONNECT
Definition: Entity.hpp:24
@ MENU
Definition: Entity.hpp:25
@ PARALLAX
Definition: Entity.hpp:23
@ ERROR
Definition: Entity.hpp:28
@ GAME
Definition: Entity.hpp:26
bool operator>(const ECS::Entity &cur, const ECS::Entity &oth)
Definition: Entity.hpp:50