Dragon-Engine icon indicating copy to clipboard operation
Dragon-Engine copied to clipboard

Modules should be able to be auto-initialized with an Init() method

Open NobleDraconian opened this issue 4 years ago • 1 comments

Currently, the framework has no way of auto-initializing modules it loads. If modules have an API method named Init(), the framework should automatically call that method to initialize the module.

This is useful in cases where a shared module wants access to framework resources.

NobleDraconian avatar Feb 12 '21 03:02 NobleDraconian

One thing to note : How should modules determine whether or not their table's __index metamethod should be set by the framework? There are cases where a module could have an Init() method but the module does not want the framework to auto call it, e.g. a Team class that has __index already set. Perhaps the method the framework looks for should be called FrameworkInit() or somesuch?

NobleDraconian avatar Feb 12 '21 03:02 NobleDraconian