Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
SystemMenu.cpp
Go to the documentation of this file.
1#include "SystemMenu.h"
2#include <algorithm>
3#include <iostream>
4#include "system_utils.h"
5
11
13{
14 if (m_active) return;
15 m_active = true;
16 // For now we just log to stdout. Integration with UI/SDL will be done later.
17 SYSTEM_LOG << "SystemMenu: activated\n";
18}
19
21{
22 if (!m_active) return;
23 m_active = false;
24 SYSTEM_LOG << "SystemMenu: deactivated\n";
25}
26
28{
29 if (m_active) Deactivate(); else Activate();
30}
31
32void SystemMenu::AddItem(const std::string& item)
33{
34 if (std::find(m_items.begin(), m_items.end(), item) == m_items.end())
35 m_items.push_back(item);
36}
37
38void SystemMenu::RemoveItem(const std::string& item)
39{
40 auto it = std::remove(m_items.begin(), m_items.end(), item);
41 if (it != m_items.end()) m_items.erase(it, m_items.end());
42}
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
void Toggle()
void Activate()
std::vector< std::string > m_items
Definition SystemMenu.h:45
bool m_active
Definition SystemMenu.h:44
void AddItem(const std::string &item)
static SystemMenu & GetInstance()
Definition SystemMenu.cpp:6
void Deactivate()
void RemoveItem(const std::string &item)
#define SYSTEM_LOG