// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Faye/Components/CoffeeMachineController.h"
#include "GameFramework/Actor.h"
#include "Interface/InteractableActorInterface.h"
#include "CoffeeMachineActor.generated.h"

class UCoffeeMachineController;
class UInteractionWidgetComponent;

UCLASS()
class FAYE_API ACoffeeMachineActor : public AActor, public IInteractableActorInterface
{
	GENERATED_BODY()
public:
	ACoffeeMachineActor();
	
	UFUNCTION(BlueprintPure, Category = "Coffee Machine")
	UCoffeeMachineController* GetCoffeeMachineController() const { return CoffeeMachineController; }
	
	UFUNCTION(BlueprintPure, Category = "Coffee Machine")
	bool IsCoffeeMakingActive() const { return CoffeeMachineController? CoffeeMachineController->IsCoffeeMakingActive() : false; }
	
	/*--- INTERACTION START ---*/
	
	virtual FText GetInteractionText_Implementation() const override { return NSLOCTEXT("Faye", "CoffeeMachineInteract", "Make Coffee"); }
	virtual bool IsInteractable_Implementation() const override { return true; }
	virtual void ToggleInteractableUI_Implementation(bool bActive) override;
	virtual void Interact_Implementation(AActor* InteractionInstigator) override;
	/*--- INTERACTION END  ---*/

protected:
	
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
	UInteractionWidgetComponent* WidgetComponent;
	
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
	UCoffeeMachineController* CoffeeMachineController;
	
	virtual void BeginPlay() override;
};
