#pragma once

#include "StateTreeTaskBase.h"
#include "Navigation/PathFollowingComponent.h"
#include "AIController.h"
#include "SeekInteractableTask.generated.h"

USTRUCT()
struct FSTTask_SeekInteractableInstanceData
{
	GENERATED_BODY()

	FAIRequestID RequestID;
	bool bMoveFinished = false;
	EPathFollowingResult::Type Result;
};

USTRUCT(meta = (DisplayName = "Seek interactable"))
struct FSeekInteractableTask : public FStateTreeTaskBase
{
	GENERATED_BODY()
	using FInstanceDataType = FSTTask_SeekInteractableInstanceData;

	UPROPERTY(EditAnywhere, Category = "Input")
	FVector TargetLocation;

	virtual EStateTreeRunStatus EnterState(
		FStateTreeExecutionContext& Context,
		const FStateTreeTransitionResult& Transition) const override;

	virtual EStateTreeRunStatus Tick(
		FStateTreeExecutionContext& Context,
		const float DeltaTime) const override;

	virtual void ExitState(
		FStateTreeExecutionContext& Context,
		const FStateTreeTransitionResult& Transition) const override;
};
