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

#pragma once

#include "CoreMinimal.h"
#include "Engine/Texture2D.h"
#include "Engine/StaticMesh.h"
#include "Engine/SkeletalMesh.h"
#include "Engine/DataTable.h"
#include "EpicEnumsAndStructs.generated.h"

/**
 * 
 */
class EPIC_INVENTORY_API EpicEnumsAndStructs
{
public:
	EpicEnumsAndStructs();
	~EpicEnumsAndStructs();

	
};

// SYSTEM WIDE ENUMS

// ITEM TYPE ENUM
UENUM(BlueprintType)
enum class EItemType : uint8
	{
		None UMETA(DisplayName = "None"),
		Armor UMETA(DisplayName = "Armor"),
		Weapon UMETA(DisplayeName = "Weapon"),
		Goods UMETA(DisplayeName = "Goods")
	};

// WEAPON CATEGORY ENUM
UENUM(BlueprintType)
enum class EWeaponCategory : uint8
	{
		None UMETA(DisplayName = "None"),
		OneHSword UMETA(DisplayName = "1H Sword"),
		TwoHSword UMETA(DisplayeName = "2H Sword"),
		Dagger UMETA(DisplayeName = "Dagger"),
		Bow UMETA(DisplayeName = "Bow"),
		OneHAxe UMETA(DisplayeName = "1H Axe"),
		TwoHAxe UMETA(DisplayeName = "2H Axe")
	};

// ARMOR CATEGORY ENUM
UENUM(BlueprintType)
enum class EArmorCategory : uint8
{
	None UMETA(DisplayName = "None"),
	Shield UMETA(DisplayName = "Shield"),
	Boots UMETA(DisplayeName = "Boots"),
	Legs UMETA(DisplayeName = "Legs"),
	Chest UMETA(DisplayeName = "Chest"),
	Arms UMETA(DisplayeName = "Arms"),
	Helmet UMETA(DisplayeName = "Helmet"),
	Jewelry UMETA(DisplayeName = "Jewelry")
};

// GOODS CATEGORY ENUM
UENUM(BlueprintType)
enum class EGoodsCategory : uint8
{
	None UMETA(DisplayName = "None"),
	Consumable UMETA(DisplayName = "Consumable"),
	QuestItem UMETA(DisplayeName = "Quest Item"),
	Book UMETA(DisplayeName = "Book"),
	Junk UMETA(DisplayeName = "Junk")
};

// ITEM RARITY ENUM
UENUM(BlueprintType)
enum class EItemRarity : uint8
{
	None UMETA(DisplayName = "None"),
	Common UMETA(DisplayName = "Common"),
	Uncommon UMETA(DisplayeName = "Uncommon"),
	Rare UMETA(DisplayeName = "Rare"),
	Epic UMETA(DisplayeName = "Epic"),
	Legendary UMETA(DisplayeName = "Legendary"),
	Mythic UMETA(DisplayeName = "Mythic")
};

//Inventory Cap Types
UENUM(BlueprintType)
enum class EInventoryCapType : uint8
{
	None UMETA(DisplayName = "None"),
	Weight UMETA(DisplayName = "Weight"),
	TotalItems UMETA(DisplayName = "Total Items"),
	TotalItemsPerCategory UMETA(DisplayName = "Total Items Per Category")

};


// SYSTEM WIDE STRUCTS

//Player starting items struct
USTRUCT(BlueprintType)
struct FStartingItems
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FDataTableRowHandle ItemDataTableAndRow;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 QuantityOfItem;
};

//Base Stat definitions
USTRUCT(BlueprintType)
struct FBaseStats
{

	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float MaxHealth;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float MaxStamina;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float MaxMana;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 Level;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float CurrentHealth;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float CurrentStamina;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float CurrentMana;

};




// Base Item Struct that defines basic details
USTRUCT(BlueprintType)
struct FBaseItemInfo : public FTableRowBase
{
	GENERATED_BODY()

	bool operator==(const FBaseItemInfo& Other) const
	{
		return Name.EqualTo(Other.Name) &&
			Description.EqualTo(Other.Description) &&
			(ItemType == Other.ItemType) &&
			(Price == Other.Price) &&
			(Rarity == Other.Rarity) &&
			(ItemWeight == Other.ItemWeight);


	}

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	FText Name;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	FText Description;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	int32 RequiredLevel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	UTexture2D* Icon;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	bool bUseSkeletalMesh;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info", meta = (EditCondition="bUseSkeletalMesh == false", EditConditionHides))
	UStaticMesh* StaticMesh;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info", meta = (EditCondition="bUseSkeletalMesh == true", EditConditionHides))
	USkeletalMesh* SkeletalMesh;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	FName EquipSocket;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	float Price;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	EItemRarity Rarity;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
	float ItemWeight;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Specific Item Info")
	EItemType ItemType;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Specific Item Info", meta = (EditCondition = "ItemType == EItemType::Goods", EditConditionHides))
	EGoodsCategory GoodsCategory;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Specific Item Info", meta = (EditCondition = "ItemType == EItemType::Armor", EditConditionHides))
	EArmorCategory ArmorCategory;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Specific Item Info", meta = (EditCondition = "ItemType == EItemType::Weapon", EditConditionHides))
	EWeaponCategory WeaponCategory;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Specific Item Info", meta = (EditCondition = "ItemType == EItemType::Armor", EditConditionHides))
	FDataTableRowHandle ArmorDataTableRow;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Specific Item Info", meta = (EditCondition = "ItemType == EItemType::Weapon", EditConditionHides))
	FDataTableRowHandle WeaponDataTableRow;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Specific Item Info", meta = (EditCondition = "ItemType == EItemType::Goods && GoodsCategory != EGoodsCategory::Junk", EditConditionHides))
	FDataTableRowHandle GoodsDataTableRow;

};

// Struct to define armor stats
USTRUCT(BlueprintType)
struct FArmorStats
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor Stats")
	float ArmorAmount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor Stats")
	float HealthAmount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor Stats")
	float StaminaAmount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor Stats")
	float ManaAmount;

};

//Struct to define weapon stats
USTRUCT(BlueprintType)
struct FWeaponStats
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Stats")
	float HackDamage;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Stats")
	float StabDamage;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Stats")
	float SlashDamage;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Stats")
	float MagicDamage;
};

//Struct for Armor Data Table
USTRUCT(BlueprintType)
struct FArmorDataTable : public FTableRowBase
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor Stats")
	FArmorStats ArmorStats;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Stat Modifiers")
	bool bModifyWeaponStats;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Stat Modifiers", meta = (EditCondition="bModifyWeaponStats == true", EditConditionHides))
	FWeaponStats WeaponStatModifiers;
};

//Struct for Weapon Data Table
USTRUCT(BlueprintType)
struct FWeaponDataTable : public FTableRowBase
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Stats")
	FWeaponStats WeaponStats;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor Stat Modifiers")
	bool bModifyArmorStats;

	UPROPERTY(EditAnywhere, blueprintReadWrite, Category = "Armor Stat Modifiers", meta = (EditCondition="bModifyArmorStats == true", EditConditionHides))
	FArmorStats ArmorStatModifiers;
};

//Struct for Goods Data Table
//USTRUCT(BlueprintType)
//struct FGoodsDataTable : public FTableRowBase
//{
//	GENERATED_BODY()
//
//public:
//
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Goods Base Info")
//	EGoodsCategory GoodsCategory;
//
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Consumable Info")
//	FDataTableRowHandle ConsumableDataTable;
//	
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest Info")
//	FDataTableRowHandle QuestItemDataTableAndRow;
//
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest Info")
//	FName ObjectiveName;
//	
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Book Info")
//	FDataTableRowHandle BookDataTable;
//
//};

//Struct for Consumable Information and Data Tables
USTRUCT(BlueprintType)
struct FConsumableInfo : public FTableRowBase
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Consumable Info")
	float Duration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Consumable Info")
	bool bModifyBaseStats;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Consumable Info")
	bool bModifyArmorStats;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Consumable Info")
	bool bModifyWeaponStats;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Stat Modifications", meta = (EditCondition = "bModifyBaseStats == true", EditConditionHides))
	FBaseStats StatModification;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor Stat Modifications", meta = (EditCondition = "bModifyArmorStats == true", EditConditionHides))
	FArmorStats ArmorModifications;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Stat Modifications", meta=(EditCondition="bModifyWeaponStats", EditConditionHides))
	FWeaponStats WeaponModifications;


};

//Struct for Quest Item information and Data Tables
USTRUCT(BlueprintType)
struct FQuestItemInfo : public FTableRowBase
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest Info")
	FName QuestName;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest Info")
	FName ObjectiveName;
};

//Struct for Book information and Data Tables
USTRUCT(BlueprintType)
struct FBookInfo : public FTableRowBase
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Book Info")
	FText BookText;
};

//USTRUCT(BlueprintType)
//struct FItemMasterInfo : public FTableRowBase
//{
//	GENERATED_BODY()
//
//public:
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
//	FDataTableRowHandle BaseItemDataTableRow;
//
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
//	EItemType ItemType;
//
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
//	int32 ItemQuantity = 1;
//
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info", meta = (EditCondition = "ItemType == EItemType::Armor", EditConditionHides))
//	FDataTableRowHandle ArmorDataTableRow;
//
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info", meta = (EditCondition = "ItemType == EItemType::Weapon", EditConditionHides))
//	FDataTableRowHandle WeaponDataTableRow;
//
//	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info", meta = (EditCondition = "ItemType == EItemType::Goods", EditConditionHides))
//	FDataTableRowHandle GoodsDataTableRow;
//};