diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-18 14:44:13 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-18 14:44:13 +0000 |
commit | db287e4a5133125bb6f25ba21ea97c47b19ac67f (patch) | |
tree | c977e4da6203344362a186010d017463d88def6e /src/core/module.h | |
parent | ade4627e7fe0f89d9fdb2e27f01444ad0aa2d41d (diff) |
minor module updates
Diffstat (limited to 'src/core/module.h')
-rw-r--r-- | src/core/module.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/core/module.h b/src/core/module.h index 20029cf..bc4f765 100644 --- a/src/core/module.h +++ b/src/core/module.h @@ -17,7 +17,7 @@ namespace core class Module { public: - Module(const char *name); + Module(const char *label, const char *name); virtual ~Module(); /*----- inspectors ------------------------------------------------ */ @@ -27,12 +27,12 @@ public: /// return true if the game module can not run a timeframe inline bool error() const { return !module_running; } - /// return the name of the module - inline std::string const & name() const { return module_name; } - /// label of the module inline std::string const & label() const { return module_label; } + /// return the name of the module + inline std::string const & name() const { return module_name; } + /// indicates if this is an interactive module or not inline bool interactive() const { return module_interactive; } @@ -58,16 +58,19 @@ public: typedef std::map<std::string, Module *> Registry; /// find a registered game module - static Module *find(const char *name); + static Module *find(const char *label); /// find a registered game module - static Module *find(std::string const &name); + static Module *find(const std::string &label); /// register a game module - static Module *add(const char *name, Module *module); + static Module *add(Module *module); /// load a registered game module - static Module *load(const char *name); + static Module *load(const char *label); + + /// list modules + static void list(); /// unload all modules static void clear(); @@ -79,6 +82,7 @@ public: static inline Registry & registry() { return module_registry; } protected: + /// set the disconnected state void abort(); @@ -86,8 +90,8 @@ protected: bool module_interactive; private: - std::string module_name; std::string module_label; + std::string module_name; static Module *module_preload; |