class MockFamily implements IFamily {
static instances: MockFamily[] = [];
constructor (nodeClass: { new (): Node; }, engine: Engine) {
MockFamily.instances.push(this);
}
/* sniiiiiip */
}
In the above example is there any way to access the static instances value from within the constructor without using the actual class name?
Static variables are always accessed trough the class-name. The class object acts as an object with properties. The closest you could come is maybe:
Though I would not recommend it.
Modules are another thing though. At run-time, their contents are variables in a function scope, and can be accessed directly almost anywhere within.