RType
src
client
Components
AComponent.cpp
Go to the documentation of this file.
1
/*
2
** EPITECH PROJECT, 2023
3
** R-type
4
** File description:
5
** R-type
6
*/
7
8
#
include
"AComponent.hpp"
9
10
/**
11
* @brief getType, get the type of the component
12
*/
13
ComponentType
AComponent
::
getType
()
const
14
{
15
return
_type
;
16
}
17
18
/**
19
* @brief addActionTarget, add a target to the action
20
* @param component
21
*/
22
void
AComponent
::
addActionTarget
(std::shared_ptr<
IComponent
> component)
23
{
24
action_target.push_back(std::move(component));
25
}
26
27
/**
28
* @brief addSubComponent, add a sub component
29
* @param component
30
*/
31
void
AComponent
::
addSubComponent
(std::shared_ptr<
IComponent
> component)
32
{
33
sub_components.push_back(std::move(component));
34
}
35
36
/**
37
* @brief setAttribute, set the attribute
38
* @param attribute
39
*/
40
void
AComponent
::
setAttribute
(std::string attribute)
41
{
42
_attribute
= attribute;
43
}
44
45
/**
46
* @brief getAttribute, get the attribute
47
* @return attribute
48
*/
49
std::string
AComponent
::
getAttribute
()
50
{
51
return
_attribute
;
52
}
Generated by
1.9.1