Open heretique opened 6 years ago
It sure would be nice if subclasses could inherit foreign classes in Wren 🤔
Wren++ doesn't really help you in that regard, unfortunately! I would probably just dump the base class bindings in a function, which would be parametrized based on module and class name. At least the purpose of the code would be clear:
bind_node_impl(vm, "spatial_node", "SpatialNode");
bind_node_impl(vm, "ui_node", "UiNode");
// etc...
This isn't optimum, since you can't freely extend the hierarchy in Wren without modifying C++ 😞
I would actually be curious about how the guy behind the Luxe engine has worked around this problem, since the engine also uses Wren heavily.
Hi, i'm using wrenpp an a toy game engine and I came to a use case where I'm a bit stuck. Suppose I have a base
Node
class and aSpatial
class that inheritsNode
. Since in wren it is not possible to subclass a foreign class, in wrenpp I have to bind all the specific base class methods for each derived class each time. What would be the best approach to automate this in wrenpp?