work on ClientModule, add ChatServer

This commit is contained in:
2025-04-17 14:16:57 -05:00
parent 2c903c276d
commit f36f6ae125
12 changed files with 314 additions and 53 deletions

View File

@@ -60,13 +60,13 @@ namespace Archimedes {
unsigned int getEventType(std::string event) { return eventTypes[event]; }
void addEventType(std::string type) {
void registerEvent(std::string type) {
//only add each type once
if(eventTypes.find(type) == eventTypes.end())
eventTypes[type] = nextEventType++;
}
void removeEventType(std::string type) {
void unregisterEvent(std::string type) {
//only erase registered types
auto it = eventTypes.find(type);
if(it != eventTypes.end())

View File

@@ -19,13 +19,15 @@ namespace Archimedes {
Module(App* a, void* h) : app(a), handle(h) {}
Module() : app(nullptr), handle(nullptr) {}
virtual ~Module() {}
virtual void run() {}
virtual bool onEvent(const Event& e) { return false; }
virtual void onLoad() {};
std::string getName() const { return name; }
operator std::string() const { return name; }
void* getHandle() { return handle; }
//std::any getData(std::string s) { return data[s.c_str()]; };