work on ClientModule, add ChatServer
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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()]; };
|
||||
|
||||
Reference in New Issue
Block a user