refactor: use of GuiManager
This commit is contained in:
@@ -10,15 +10,17 @@ namespace gui {
|
||||
|
||||
class GuiManager {
|
||||
private:
|
||||
std::vector<std::shared_ptr<GuiWidget>> m_Widgets;
|
||||
std::vector<std::unique_ptr<GuiWidget>> m_Widgets;
|
||||
public:
|
||||
GuiManager(){}
|
||||
|
||||
void renderWidgets() {
|
||||
for (auto widget : m_Widgets) {
|
||||
for (auto& widget : m_Widgets) {
|
||||
widget->render();
|
||||
}
|
||||
}
|
||||
|
||||
void addWidgets(const std::shared_ptr<GuiWidget>& widget) {
|
||||
void addWidget(std::unique_ptr<GuiWidget>&& widget) {
|
||||
m_Widgets.push_back(std::move(widget));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user