ServerEvents
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include "utils/Module/Module.h"
|
||||
#include "utils/App/App.h"
|
||||
|
||||
#include "utils/Events/Event.h"
|
||||
|
||||
#include "entryPoint.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <future>
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <chrono>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user