RType
AComponent.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 "IComponent.hpp"
11 #include <memory>
12 #include <vector>
13 
14 class AComponent : public IComponent
15 {
16  public:
17 
18  /**
19  * @brief AComponent, constructor of AComponent
20  */
21  explicit AComponent(ClientCore *clientCore) :
22  IComponent(clientCore)
23  {
24  }
25 
26  /**
27  * @brief ~AComponent, destructor of AComponent
28  */
29  ~AComponent() override = default;
30 
31  /**
32  * @brief getType, get the type of the component
33  */
34  [[nodiscard]] ComponentType getType() const override;
35 
36  /**
37  * @brief addActionTarget, add a target to the action
38  * @param component
39  */
40  void addActionTarget(std::shared_ptr<IComponent> component) override;
41 
42  /**
43  * @brief addSubComponent, add a sub component
44  * @param component
45  */
46  void addSubComponent(std::shared_ptr<IComponent> component) override;
47 
48  /**
49  * @brief setAttribute, set the attribute
50  * @param attribute
51  */
52  void setAttribute(std::string attribute) override;
53 
54  /**
55  * @brief getAttribute, get the attribute
56  * @return attribute
57  */
58  [[nodiscard]]
59  std::string getAttribute() override;
60 };