ServerEvents

This commit is contained in:
2025-04-15 00:35:31 -05:00
parent ba8d31335e
commit f94cb10412
7 changed files with 123 additions and 19 deletions

View File

@@ -4,6 +4,8 @@
#include "utils/Module/Module.h"
#include "utils/App/App.h"
#include "utils/Events/Event.h"
#include "entryPoint.h"
#endif

View File

@@ -10,6 +10,7 @@
#include <future>
#include <unordered_map>
#include <map>
#include <functional>
#include <optional>
#include <chrono>

View File

@@ -53,17 +53,26 @@ namespace Archimedes {
void end() { done = true; }
bool isDone() const { return done; }
std::unordered_map<std::string, unsigned int> getEventTypes() const { return eventTypes; }
void addEventType(std::string type) { eventTypes[type] = nextEventType++; }
private:
std::list<std::string>::iterator roInsert;
inline static App* instance = nullptr;
unsigned int nextEventType = 0;
protected:
bool done = false;
std::unordered_map<std::string, Module*> modules;
std::unordered_map<std::string, unsigned int> eventTypes;
std::list<std::string> runOrder;
std::list<std::string> toClose;

View File

@@ -9,21 +9,8 @@ namespace Archimedes {
public:
enum class Type : unsigned int {
None = 0,
WindowEvent = 1 << 0,
KeyEvent = 1 << 1,
MouseMoveEvent = 1 << 2,
MouseScrollEvent = 1 << 3,
MouseButtonEvent = 1 << 4,
PressedEvent = 1 << 5,
ReleasedEvent = 1 << 6,
WindowCloseEvent = 1 << 7,
WindowResizeEvent = 1 << 8,
};
unsigned int type;
};
}