WurstScript
WurstScript copied to clipboard
Module: call constructor via `new thistype()`
Add the possibility to call the constructor of the underlying class of a module using new thistype().
Example:
module MyModule
static function getNew() returns thistype
return new thistype()
class MyClass
use MyModule
init
MyClass obj = MyClass.getNew()
Please dont ask what i need this for, its complicated :/
Modules currently do not know which constructors the using class provides. So this feature would require some more features.
You could just add an abstract method to the module for creating a new instance. Then the user of the module has to write two more lines.
Is this for the buff system object generation?