// Copyright Pacificao. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "AgrarianInteractable.h"
#include "AgrarianTypes.h"
#include "AgrarianItemPickup.generated.h"

class AAgrarianGameCharacter;
class UAgrarianItemDefinitionAsset;
class UStaticMeshComponent;

UCLASS(Blueprintable)
class AGRARIANGAME_API AAgrarianItemPickup : public AActor, public IAgrarianInteractable
{
	GENERATED_BODY()

public:
	AAgrarianItemPickup();

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Agrarian|Pickup")
	TObjectPtr<UStaticMeshComponent> Mesh;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Pickup")
	FAgrarianItemStack PickupStack;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Pickup")
	TObjectPtr<UAgrarianItemDefinitionAsset> ItemDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Pickup", meta = (ClampMin = "1"))
	int32 Quantity = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Pickup")
	FText InteractionVerb;

	virtual FText GetInteractionText_Implementation(const AAgrarianGameCharacter* Interactor) const override;
	virtual bool CanInteract_Implementation(const AAgrarianGameCharacter* Interactor) const override;
	virtual void Interact_Implementation(AAgrarianGameCharacter* Interactor) override;

	UFUNCTION(BlueprintCallable, Category = "Agrarian|Pickup")
	FAgrarianItemStack MakePickupStack() const;
};
