Download

Forcing an actor with an interface to have a property

Say I have an interface, IIdentifiable. I want to enforce the idea that anything which inherits this interface has an int called ID. Obviously, I could just assume whatever inherits this interface will just create its own ID, but the idea is to enforce it. Is there a way of doing this?

No. only if you do code reflection, but then the property won’t be visible to C++, only through reflection too.
The user should add the property manually.