Stub in AI controller

This commit is contained in:
Kevin Poretti 2023-11-15 20:42:40 -05:00
parent 14cc6304c4
commit da392c03fb
5 changed files with 84 additions and 3 deletions

View File

@ -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<FFFInputSequence>& InInputSequences)
{
return false;
}
FVector AFFAIController::GetInputAsWorldDirection() const
{
return FVector::ZeroVector;
}
void AFFAIController::DisableMostRecentInput()
{
InputBuffer->DisableMostRecentInput();
}

View File

@ -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<FFFInputSequence>& 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;
};

View File

@ -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<FFFInputSequence>& InputSequences) override;
virtual FVector GetInputAsWorldDirection() const override;
virtual void DisableMostRecentInput() override;
// End of IFFStateOwnerInterface

View File

@ -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<FFFInputSequence>& InInputSequences) = 0;
// TODO: document
virtual FVector GetInputAsWorldDirection() const = 0;
// TODO: document
virtual void DisableMostRecentInput() = 0;
};

View File

@ -26,6 +26,7 @@ public class UnrealFightingFramework : ModuleRules
{
"Core",
"EnhancedInput",
"AIModule",
// ... add other public dependencies that you statically link with here ...
}
);