Rubik’s Eclipse Update #1

I’m working on a State Machine Pattern which I’ve done in at least Java and C++ before. Unfortunately, while Java and C++ allow pure virtual functions Unreal Engine 4 does not.

Virtual Function that breaks UE4
Error Message

I’m still learning Unreal Engine so I was not sure if there was a work around that I wasn’t aware of so I searched online for a solution.

Solution from Unreal Engines AsnwerHub

Now this isn’t exactly what I was looking for; but, this macro is a perfectly functional solution to mitigate the issue of having instantiated classes that were intended to be abstract.

cannot instantiate abstract class
virtual bool isValidOption(AEclipseBoard* board, AEclipseSpace* space) 
  check(0 && "You must override this"); 
  return false; 

Leave a Reply

Your email address will not be published. Required fields are marked *