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

#pragma once

#include "HYInteractableActor.h"
#include "InventoryItem.h"
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "HYPlayerCharacController.generated.h"

/**
 * 
 */
UCLASS()
class HWANYOUNG2_API AHYPlayerCharacController : public APlayerController
{
	GENERATED_BODY()

public: 
#pragma region inventory
	//setting up the controller inventory
	AHYPlayerCharacController();

	
	UFUNCTION(BlueprintImplementableEvent)
	void ReloadInventory();

	UFUNCTION(BlueprintImplementableEvent)
	void ReloadCraftUI();

	UFUNCTION(BlueprintImplementableEvent)
	void SaveGameplay();

	UFUNCTION(BlueprintCallable, Category = "Utils")
	int32 GetInventoryWeight();

	UFUNCTION(BlueprintCallable, Category = "Utils")
	bool AddItemToInventoryByID(FName ID);

	UFUNCTION(BlueprintCallable, Category = "Utils")
	FInventoryItem CraftItem(FInventoryItem ItemA);

	UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
	class AHYInteractableActor* CurrentInteractable;

	UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
	TArray<FInventoryItem> Inventory;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 InventorySlotLimit;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 InventoryWeightLimit;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 Currency;


	UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
	TSet<FName> CraftingItems;

	//interacts with the Interactable objects
	UFUNCTION(BlueprintCallable, Category = "Utils")
	void Interact();

#pragma endregion


protected: 

	//abstract function to override in order to 
	//bind actions or axis to different input components
	virtual void SetupInputComponent() override;

	virtual void OnPossess(APawn* InPawn) override;
};
