Add CogInterfaces plugin to fix interface usage when compiling shipping builds

This commit is contained in:
Arnaud Jamin
2023-10-02 17:27:19 -04:00
parent 82eb2d77e7
commit 81540a77f0
30 changed files with 247 additions and 81 deletions
@@ -0,0 +1,44 @@
using UnrealBuildTool;
public class CogInterfaces : ModuleRules
{
public CogInterfaces(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
}
);
PrivateIncludePaths.AddRange(
new string[] {
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
}
);
}
}
@@ -0,0 +1,17 @@
#include "CogInterfacesModule.h"
#define LOCTEXT_NAMESPACE "FCogInterfacesModule"
//--------------------------------------------------------------------------------------------------------------------------
void FCogInterfacesModule::StartupModule()
{
}
//--------------------------------------------------------------------------------------------------------------------------
void FCogInterfacesModule::ShutdownModule()
{
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FCogInterfacesModule, CogInterfaces)
@@ -0,0 +1,29 @@
#pragma once
#include "CoreMinimal.h"
#include "CogInterfacesAllegiance.generated.h"
//--------------------------------------------------------------------------------------------------------------------------
UENUM(BlueprintType)
enum class ECogInterfacesAllegiance : uint8
{
Ally,
Enemy
};
//--------------------------------------------------------------------------------------------------------------------------
UINTERFACE(MinimalAPI, Blueprintable)
class UCogInterfacesAllegianceActor : public UInterface
{
GENERATED_BODY()
};
//--------------------------------------------------------------------------------------------------------------------------
class ICogInterfacesAllegianceActor
{
GENERATED_BODY()
public:
virtual ECogInterfacesAllegiance GetAllegiance(const AActor* OtherActor) const = 0;
};
@@ -0,0 +1,46 @@
#pragma once
#include "CoreMinimal.h"
#include "CogInterfacesDamageActor.generated.h"
//--------------------------------------------------------------------------------------------------------------------------
UENUM(BlueprintType)
enum class ECogInterfacesDamageEventType : uint8
{
DamageDealt,
DamageReceived,
};
//--------------------------------------------------------------------------------------------------------------------------
USTRUCT()
struct FCogInterfacesDamageParams
{
GENERATED_BODY()
ECogInterfacesDamageEventType Type;
TObjectPtr<AActor> DamageDealer;
TObjectPtr<AActor> DamageReceiver;
float MitigatedDamage = 0;
float IncomingDamage = 0;
bool IsCritical = false;
};
//--------------------------------------------------------------------------------------------------------------------------
DECLARE_MULTICAST_DELEGATE_OneParam(FCogAbilityOnDamageEvent, const FCogInterfacesDamageParams&);
//--------------------------------------------------------------------------------------------------------------------------
UINTERFACE(MinimalAPI, Blueprintable)
class UCogInterfacesDamageActor : public UInterface
{
GENERATED_BODY()
};
//--------------------------------------------------------------------------------------------------------------------------
class ICogInterfacesDamageActor
{
GENERATED_BODY()
public:
virtual FCogAbilityOnDamageEvent& OnDamageEvent() = 0;
};
@@ -0,0 +1,17 @@
#pragma once
#include "CoreMinimal.h"
#include "CogInterfacesFilteredActor.generated.h"
UINTERFACE(MinimalAPI, Blueprintable)
class UCogInterfacesFilteredActor : public UInterface
{
GENERATED_BODY()
};
class ICogInterfacesFilteredActor
{
GENERATED_BODY()
virtual bool IsActorFilteringDebug() const { return true; }
};
@@ -0,0 +1,17 @@
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
class COGINTERFACES_API FCogInterfacesModule : public IModuleInterface
{
public:
static inline FCogInterfacesModule& Get() { return FModuleManager::LoadModuleChecked<FCogInterfacesModule>("CogInterfaces"); }
virtual void StartupModule() override;
virtual void ShutdownModule() override;
private:
};