#pragma once
#include <vector>

#include "GridSystem/WorldTile.h"


enum class InventoryItem {
	Empty,
	Bronzium,
	Diamond,
	Einsteinium,
	Emerald,
	Goldium,
	Ironium,
	Platinum,
	Platnium,
	Ruby,
	Silverium,
	Special,
};

struct ItemStack {
	ItemStack(InventoryItem type, int quantity) : m_ItemType{ type }, m_Quantity{ quantity } {}
	InventoryItem m_ItemType;
	int m_Quantity{ 0 };
};

class PlayerInventory final {
public:
	PlayerInventory();
	~PlayerInventory();

	PlayerInventory(PlayerInventory& other) = delete;
	PlayerInventory& operator=(PlayerInventory& other) = delete;
	PlayerInventory(PlayerInventory&& other) = delete;
	PlayerInventory& operator=(PlayerInventory&& other) = delete;

	void ClearInventory();
	int GetTotalValue() const;
	void AddItem(const ItemStack& item);
	void RemoveItem(ItemStack* item);
	std::vector<ItemStack*> GetItems() const;
	InventoryItem GetItemByType(GroundTileType* tile);
	static std::string GetItemName(InventoryItem item);
	static int GetItemValue(InventoryItem item);
	static Texture* GetItemIcon(InventoryItem item);


private:
	std::vector<ItemStack*> m_Items;
};
