- Create a new Interface called Selectable:
- Define the following functions inside ISelectable:
class CHAPTER_07_API ISelectable{ GENERATED_BODY() // Add interface functions to this class. This is the class that will // be inherited to implement this interface.public: virtual bool IsSelectable(); virtual bool TrySelect(); virtual void Deselect();};
- Provide a default implementation for the functions, like so:
#include "Selectable.h"// Add default functionality here for any ISelectable functions that are not pure virtual.bool ISelectable::IsSelectable(){ GEngine->AddOnScreenDebugMessage(-1, 1, FColor::Red, "Selectable"); ...