#ifndef EQUIPMENT_HPP_INCLUDED
#define EQUIPMENT_HPP_INCLUDED

#include "../../../Game/Interactable/Item.hpp"
#include <cstdint>
#include <vector>
#include <string>
#include <functional>

namespace Equipment
{
    typedef enum SLOT
    {
        HEAD,
        CAPE,
        NECK,
        WEAPON,
        BODY,
        SHIELD,
        LEGS,
        HANDS,
        FEET,
        RING,
        AMMO
    } SLOT;

    bool IsOpen();
    bool Open(bool UseHotkey = false);
    bool IsEmpty();
    std::int32_t GetTabHotkey();

    std::vector<int32_t> GetItemIDs();
    std::vector<std::string> GetItemNames();
    std::vector<std::int32_t> GetItemAmounts();

    std::vector<Interactable::Item> GetItems();
    std::vector<Interactable::Item> GetItems(std::int32_t ID);
    std::vector<Interactable::Item> GetItems(const std::string& Name);
    std::vector<Interactable::Item> GetItems(const std::vector<SLOT>& Slots);
    std::vector<Interactable::Item> GetItems(const std::vector<std::int32_t>& IDs);
    std::vector<Interactable::Item> GetItems(const std::vector<std::string>& Names);
    std::vector<Interactable::Item> GetItems(const std::function<bool (const Interactable::Item&)>& Filter);

    Interactable::Item GetItem(SLOT Slot);
    Interactable::Item GetItem(std::int32_t ID);
    Interactable::Item GetItem(const std::string& Name);
    Interactable::Item GetItem(const std::vector<std::int32_t>& IDs);
    Interactable::Item GetItem(const std::vector<std::string>& Names);
    Interactable::Item GetItem(const std::function<bool (const Interactable::Item&)>& Filter);

    std::int32_t Count(SLOT Slot);
    std::int32_t Count(std::int32_t ID);
    std::int32_t Count(const std::string& Name);
    std::int32_t Count(const Interactable::Item& Item);
    std::int32_t Count(const std::vector<std::int32_t>& IDs);
    std::int32_t Count(const std::vector<std::string>& Names);
    std::int32_t Count(const std::vector<Interactable::Item>& Items);

    SLOT GetSlotOf(std::int32_t ID);
    SLOT GetSlotOf(const std::string& Name);

    bool Contains(std::int32_t ID);
    bool Contains(const std::string& Name);
    bool Contains(const Interactable::Item& Item);
    bool Contains(const std::vector<std::int32_t>& IDs); // true if all items are found at least once
    bool Contains(const std::vector<std::string>& Names); // true if all items are found at least once
    bool Contains(const std::vector<Interactable::Item>& Items);

    bool ContainsAny(const std::vector<std::int32_t>& IDs);
    bool ContainsAny(const std::vector<std::string>& Names);
    bool ContainsAny(const std::vector<Interactable::Item>& Items);

    bool ContainsOnly(std::int32_t ID);
    bool ContainsOnly(const std::string& Name);
    bool ContainsOnly(const Interactable::Item& Item);
    bool ContainsOnly(const std::vector<std::int32_t>& IDs);
    bool ContainsOnly(const std::vector<std::string>& Names);
    bool ContainsOnly(const std::vector<Interactable::Item>& Items);

    bool Unequip(SLOT Slot);
    bool Unequip(std::int32_t ID);
    bool Unequip(const std::string& Name);
    bool Unequip(const Interactable::Item& Item);
}

#endif // EQUIPMENT_HPP_INCLUDED
