Heya,
Say I have two classes, Base and Derived (Base derives from ACharacter). Base binds SomeVirtualFunction to some action input, and Derived overrides it. Now, it’d be awesome if I could do this:
bool bConsumedInput = Super::SomeVirtualFunction();
if(!bConsumedInput) { //do stuff }
My practical use case is having a SharedCharacter which is inherited by PlayerCharacter and MountCharacter. Only the former derivation can attack, but both can read signs, which is a higher priority (if a sign is in front of a player). I implement the sign reading in SharedCharacter, and I gotta check in my PlayerCharacter if any of that happened, before trigger my Attack action. Right now I do it via a protected placeholder bool, which feels a bit hacky. If we could have return types on bind functions it’d make it much more elegant. I know the Android SDK (and probably many more) implement this feature. Thanks in advance!
Best regards,
Damir H.