RType
src
lib
r_type
entities
IEntity.hpp
Go to the documentation of this file.
1
/*
2
** EPITECH PROJECT, 2023
3
** R-type
4
** File description:
5
** R-type
6
*/
7
8
#
pragma
once
9
10
#
include
"../components/IComponent.hpp"
11
#
include
<
memory
>
12
#
include
<
vector
>
13
14
class
IEntity
15
{
16
public
:
17
18
/**
19
* @brief Construct a new IEntity object
20
*
21
*/
22
IEntity
()
23
{
24
setAttribute
(
""
);
25
}
26
27
/**
28
* @brief Destroy the IEntity object
29
*
30
*/
31
~
IEntity
() =
default
;
32
33
34
/**
35
* @brief Get the Components object
36
*
37
* @return std::vector<std::shared_ptr<IComponentRType>>
38
*/
39
[[
nodiscard
]]
std
::
vector
<
std
::
shared_ptr
<
IComponentRType
>>
getComponents
()
const
40
{
41
return
_components;
42
}
43
44
45
/**
46
* @brief addComponent, add a component to the entity
47
*
48
* @param component
49
*/
50
void
addComponent
(
const
std::shared_ptr<
IComponentRType
> &component)
51
{
52
_components.push_back(component);
53
}
54
55
/**
56
* @brief Get the Attribute object
57
*
58
* @return std::string
59
*/
60
[[
nodiscard
]] std::string
getAttribute
()
const
61
{
62
return
_attribute
;
63
}
64
65
/**
66
* @brief Set the Attribute object
67
*
68
* @param attribute
69
*/
70
void
setAttribute
(
const
std::string &attribute)
71
{
72
_attribute
= attribute;
73
}
74
75
protected
:
76
std
::
vector
<
std
::
shared_ptr
<
IComponentRType
>>
_components
;
77
std::string
_attribute
;
78
};
Generated by
1.9.1