klawr
klawr copied to clipboard
Eliminate constructors in UObject and UKlawrScriptComponent wrapper classes
The constructors in question:
public UObject(UObjectHandle nativeObject)
public UKlawrScriptComponent(long instanceID, UObjectHandle nativeComponent)
Whenever a user subclasses UKlawrScriptComponent they have to write a constructor to pass these parameters to the base class, this is tedious, and these parameters are internal implementation details that most users shouldn't ever worry about. Users shouldn't be forced to write a constructor at all!
What you can do is:
- a Factory approach with an Initialize method in the base class and make the constructor internal, so it cant be called from other assemblies.
- Internal parameterless constructor + Private parameterized constructor with a static generic method + private Initialize. I'll fix something up tomorrow.