make apps customizable
This commit is contained in:
@@ -11,11 +11,17 @@ namespace Archimedes {
|
||||
|
||||
friend class App;
|
||||
|
||||
static std::list<std::string*> modules;
|
||||
|
||||
public:
|
||||
typedef Module* create_t(void*, App&);
|
||||
typedef Module* create_t(void*, App*);
|
||||
|
||||
static std::list<std::string*>& GetModules() { return modules; }
|
||||
|
||||
Module(void* h, App* a) : handle(h), app(a) { modules.push_back(&name); }
|
||||
|
||||
virtual ~Module() { modules.remove_if([this](std::string* s) -> bool { return s ? *s == name : false; }); }
|
||||
|
||||
Module(void* h, App& a) : handle(h), app(a) {};
|
||||
virtual ~Module() {}
|
||||
virtual void run() = 0;
|
||||
virtual void onLoad() = 0;
|
||||
|
||||
@@ -29,7 +35,7 @@ namespace Archimedes {
|
||||
void* handle;
|
||||
std::list<Module*>::iterator self;
|
||||
|
||||
App& app;
|
||||
App* app;
|
||||
|
||||
std::unordered_map<std::string, std::string> deps;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user