diff --git a/Source/UnrealFightingFramework/GameplayFramework/FFAIController.cpp b/Source/UnrealFightingFramework/GameplayFramework/FFAIController.cpp new file mode 100644 index 0000000..755b91b --- /dev/null +++ b/Source/UnrealFightingFramework/GameplayFramework/FFAIController.cpp @@ -0,0 +1,29 @@ +// Project Sword & Gun Copyright Kevin Poretti + + +#include "GameplayFramework/FFAIController.h" + +AFFAIController::AFFAIController() +{ + bWantsPlayerState = true; +} + +bool AFFAIController::CheckInputSequence(const FFFInputSequence& InInputSequence) +{ + return false; +} + +bool AFFAIController::CheckInputSequences(const TArray& InInputSequences) +{ + return false; +} + +FVector AFFAIController::GetInputAsWorldDirection() const +{ + return FVector::ZeroVector; +} + +void AFFAIController::DisableMostRecentInput() +{ + InputBuffer->DisableMostRecentInput(); +} diff --git a/Source/UnrealFightingFramework/GameplayFramework/FFAIController.h b/Source/UnrealFightingFramework/GameplayFramework/FFAIController.h new file mode 100644 index 0000000..b0b0b58 --- /dev/null +++ b/Source/UnrealFightingFramework/GameplayFramework/FFAIController.h @@ -0,0 +1,42 @@ +// Project Sword & Gun Copyright Kevin Poretti + +#pragma once + +// FF includes +#include "State/IFFStateOwnerInterface.h" +#include "Input/FFInputBufferComponent.h" + +// UE includes +#include "CoreMinimal.h" +#include "AIController.h" + +#include "FFAIController.generated.h" + +/** + * + */ +UCLASS() +class UNREALFIGHTINGFRAMEWORK_API AFFAIController : public AAIController, public IFFStateOwnerInterface +{ + GENERATED_BODY() + +public: + AFFAIController(); + + // IFFStateOwnerInterface + UFUNCTION(BlueprintCallable, Category="UFF State Owner Interface") + virtual bool CheckInputSequence(const FFFInputSequence& InInputSequence) override; + + UFUNCTION(BlueprintCallable, Category="UFF State Owner Interface") + virtual bool CheckInputSequences(const TArray& InInputSequences) override; + + virtual FVector GetInputAsWorldDirection() const override; + + virtual void DisableMostRecentInput() override; + // End of IFFStateOwnerInterface + +protected: + /** Input Buffer component */ + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "UFF|Input", meta = (AllowPrivateAccess = "true")) + UFFInputBufferComponent* InputBuffer; +}; diff --git a/Source/UnrealFightingFramework/Input/FFPlayerController.h b/Source/UnrealFightingFramework/Input/FFPlayerController.h index cdceb7d..f436614 100644 --- a/Source/UnrealFightingFramework/Input/FFPlayerController.h +++ b/Source/UnrealFightingFramework/Input/FFPlayerController.h @@ -57,9 +57,6 @@ public: // TODO: document void ConsumeMoveInput(); - // TODO: document - FVector GetInputAsWorldDirection() const; - // TODO: document void AddCurrentInputToBuffer(); @@ -70,6 +67,8 @@ public: UFUNCTION() virtual bool CheckInputSequences(const TArray& InputSequences) override; + virtual FVector GetInputAsWorldDirection() const override; + virtual void DisableMostRecentInput() override; // End of IFFStateOwnerInterface diff --git a/Source/UnrealFightingFramework/State/IFFStateOwnerInterface.h b/Source/UnrealFightingFramework/State/IFFStateOwnerInterface.h index 5aeb2e4..ae9fc0d 100644 --- a/Source/UnrealFightingFramework/State/IFFStateOwnerInterface.h +++ b/Source/UnrealFightingFramework/State/IFFStateOwnerInterface.h @@ -2,6 +2,10 @@ #pragma once +// FF includes +#include "Input/FFInputBufferComponent.h" + +// UE includes #include "CoreMinimal.h" #include "UObject/Interface.h" @@ -21,11 +25,17 @@ class UNREALFIGHTINGFRAMEWORK_API IFFStateOwnerInterface GENERATED_BODY() public: + // TODO: document UFUNCTION(BlueprintCallable, Category="UFF State Owner Interface") virtual bool CheckInputSequence(const FFFInputSequence& InInputSequence) = 0; + // TODO: document UFUNCTION(BlueprintCallable, Category="UFF State Owner Interface") virtual bool CheckInputSequences(const TArray& InInputSequences) = 0; + // TODO: document + virtual FVector GetInputAsWorldDirection() const = 0; + + // TODO: document virtual void DisableMostRecentInput() = 0; }; diff --git a/Source/UnrealFightingFramework/UnrealFightingFramework.Build.cs b/Source/UnrealFightingFramework/UnrealFightingFramework.Build.cs index b6a13a9..a1b0d03 100644 --- a/Source/UnrealFightingFramework/UnrealFightingFramework.Build.cs +++ b/Source/UnrealFightingFramework/UnrealFightingFramework.Build.cs @@ -26,6 +26,7 @@ public class UnrealFightingFramework : ModuleRules { "Core", "EnhancedInput", + "AIModule", // ... add other public dependencies that you statically link with here ... } );