I’m trying to create an interface for my Room classes that will be fired PreSave, PostLoad and when a player has finished loading. So, I implemented an interface for this. I already have the hooks in place and the interface itself is fairly simple.
RSaveInterface.h
#include "CoreMinimal.h"
#include "RSaveInterface.generated.h"
// This class does not need to be modified.
UINTERFACE(MinimalAPI)
class URSaveInterface : public UInterface
{
GENERATED_BODY()
};
/**
*
*/
class MYPROJECT_API IRSaveInterface
{
GENERATED_BODY()
public:
//CPP Function call called by the RSaveComponent before the blueprint PreSave Event
void PreSave();
//CPP Function call called by the RSaveComponent before the blueprint PostLoad Event
void PostLoad();
//CPP Function call called by the RSaveComponent before the blueprint PlayerLoaded Event
void PlayerLoaded(APlayerController* PC, APawn* Pawn, int32 PlayerIndex);
};
RSaveInterface.cpp
#include "RSaveInterface.h"
void IRSaveInterface::PreSave() {}
void IRSaveInterface::PostLoad() {}
void IRSaveInterface::PlayerLoaded(APlayerController* PC, APawn* Pawn, int32 PlayerIndex) {}
When I go to implement the interface on my RoomActor I use multiple Inheritance just like the docs say
class MYPROJECT_API ARRoom : public AActor, public IRSaveInterface
But when I try to override the implemented function, I get a bunch of errors:
error C3668: 'ARRoom::PostLoad_Implementation': method with override specifier 'override' did not override any base class methods RSaveInterface.gen.cpp
error C3668: 'ARRoom::PostLoad_Implementation': method with override specifier 'override' did not oerror C3668: 'ARRoom::PostLoad_Implementation': method with override specifier 'override' did not override any base class methodsverride any base class methods
error C3668: 'ARRoom::PostLoad_Implementation': method with override specifier 'override' did not override any base class methods
etc…