diff options
Diffstat (limited to 'src/core/module.h')
-rw-r--r-- | src/core/module.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/core/module.h b/src/core/module.h index 61dc0dc..bd99034 100644 --- a/src/core/module.h +++ b/src/core/module.h @@ -49,23 +49,38 @@ public: /*----- static ---------------------------------------------------- */ - /// load a game module - static void load(Module *module); + typedef std::map<std::string, Module *> Registry; - /// unload the preloaded module - static void unload(); + /// find a registered game module + static Module *find(const char *name); + + /// find a registered game module + static Module *find(std::string const &name); - /// the preloaded module - inline static Module *preload() { return module_preload; }; + /// register a game module + static Module *add(const char *name, Module *module); + + /// load a registered game module + static Module *load(const char *name); + + /// unload all modules + static void clear(); + + /// currently loaded module + static inline Module *current() { return module_preload; } protected: /// set the disconnected state void abort(); + bool module_running; private: - static Module *module_preload; std::string module_name; + + static Module *module_preload; + + static Registry module_registry; }; } |