diff options
author | Stijn Buys <ingar@osirion.org> | 2008-09-28 15:05:13 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-09-28 15:05:13 +0000 |
commit | fd778219e40c5fbb4d0af1839cbc313caaf10d9d (patch) | |
tree | b6e413f4c1a5ba4091503ba97c784278485d3933 /src/core/module.h | |
parent | bedcff956d253621ec00aa7d2919c22a4c88b0b2 (diff) |
move base game module to new subdirectory
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; }; } |