9 #include <unordered_map>
29 UIComponent(std::string name, std::shared_ptr<GameObject>
object);
44 static void addComponentToObject(std::shared_ptr<GameObject>
object, std::shared_ptr<UIComponent> component);
52 static std::vector<std::shared_ptr<UIComponent>>
getComponentsOfObject(std::shared_ptr<GameObject>
object);
61 static std::unordered_map<std::shared_ptr<GameObject>, std::vector<std::shared_ptr<UIComponent>>>
_objectComponents;
Contains the declaration of the GameObject class, representing a game object in the system.
A base class representing a user interface (UI) for a game object's component.
Definition: UIComponent.hpp:21
static std::unordered_map< std::shared_ptr< GameObject >, std::vector< std::shared_ptr< UIComponent > > > _objectComponents
Definition: UIComponent.hpp:61
static std::vector< std::shared_ptr< UIComponent > > getComponentsOfObject(std::shared_ptr< GameObject > object)
Static method to retrieve a list of UI components associated with a game object.
Definition: UIComponent.cpp:17
virtual void draw()=0
Abstract method to draw the UI component.
static void addComponentToObject(std::shared_ptr< GameObject > object, std::shared_ptr< UIComponent > component)
Static method to add a UI component to a game object.
Definition: UIComponent.cpp:10
uint64_t _uuid
A unique identifier for the UI component.
Definition: UIComponent.hpp:55
std::shared_ptr< GameObject > _object
The game object associated with the UI component.
Definition: UIComponent.hpp:57
std::string _name
The name of the UI component.
Definition: UIComponent.hpp:56
UIComponent(std::string name, std::shared_ptr< GameObject > object)
Constructor to create a UI component with a specified name and associated game object.
Definition: UIComponent.cpp:6