2017-12-25 23:49:48 +00:00
|
|
|
#ifndef INVENTORY_HPP_INCLUDED
|
|
|
|
#define INVENTORY_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include "../../../Core/Types/Box.hpp"
|
|
|
|
#include "../../../Core/Types/Convex.hpp"
|
2018-06-28 02:22:43 +00:00
|
|
|
#include "../../../Game/Interactable/Item.hpp"
|
|
|
|
#include <functional>
|
2017-12-25 23:49:48 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
/** @addtogroup GameTabs
|
|
|
|
* @{ */
|
|
|
|
class Inventory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
static bool IsOpen();
|
|
|
|
static bool Open();
|
|
|
|
|
|
|
|
static std::vector<std::int32_t> GetItemIDs();
|
|
|
|
static std::vector<std::string> GetItemNames();
|
|
|
|
static std::vector<std::int32_t> GetItemAmounts();
|
|
|
|
|
2018-06-28 02:22:43 +00:00
|
|
|
static std::vector<Interactable::Item> GetItems();
|
|
|
|
static std::vector<Interactable::Item> GetItems(std::int32_t ID);
|
|
|
|
static std::vector<Interactable::Item> GetItems(const std::string& Name);
|
|
|
|
static std::vector<Interactable::Item> GetItems(const std::vector<std::int32_t>& IDs);
|
|
|
|
static std::vector<Interactable::Item> GetItems(const std::vector<std::string>& Names);
|
|
|
|
static std::vector<Interactable::Item> GetItems(const std::function<bool (const Interactable::Item&)>& Filter);
|
|
|
|
|
|
|
|
static Interactable::Item GetItem(std::int32_t ID);
|
|
|
|
static Interactable::Item GetItem(const std::string& Name);
|
|
|
|
static Interactable::Item GetItem(const std::vector<std::int32_t>& IDs);
|
|
|
|
static Interactable::Item GetItem(const std::vector<std::string>& Names);
|
|
|
|
static Interactable::Item GetItem(const std::function<bool (const Interactable::Item&)>& Filter);
|
|
|
|
|
2017-12-25 23:49:48 +00:00
|
|
|
static bool IsEmpty();
|
|
|
|
static bool IsFull();
|
|
|
|
|
|
|
|
static bool IsItemSelected();
|
|
|
|
static bool IsItemSelected(std::int32_t ID);
|
|
|
|
static bool IsItemSelected(const std::string& Name);
|
2018-06-28 02:22:43 +00:00
|
|
|
static bool IsItemSelected(const Interactable::Item& Item);
|
2017-12-25 23:49:48 +00:00
|
|
|
|
|
|
|
static std::string GetItemSelectedName();
|
|
|
|
|
|
|
|
static std::int32_t Count(std::int32_t ID);
|
|
|
|
static std::int32_t Count(const std::string& Name);
|
2018-06-28 02:22:43 +00:00
|
|
|
static std::int32_t Count(const Interactable::Item& Item);
|
2017-12-25 23:49:48 +00:00
|
|
|
static std::int32_t Count(const std::vector<std::int32_t>& IDs);
|
|
|
|
static std::int32_t Count(const std::vector<std::string>& Names);
|
2018-06-28 02:22:43 +00:00
|
|
|
static std::int32_t Count(const std::vector<Interactable::Item>& Items);
|
2017-12-25 23:49:48 +00:00
|
|
|
|
|
|
|
static std::int32_t CountOccupied();
|
|
|
|
static std::int32_t CountEmpty();
|
|
|
|
|
|
|
|
static std::int32_t GetIndexOf(std::int32_t ID);
|
|
|
|
static std::int32_t GetIndexOf(const std::string& Name);
|
|
|
|
static std::int32_t GetIndexOf(const std::vector<std::int32_t>& IDs); // Returns first found ID index
|
|
|
|
static std::int32_t GetIndexOf(const std::vector<std::string>& Names); // Returns first found Name Index
|
|
|
|
|
|
|
|
static std::vector<std::int32_t> GetIndicesOf(std::int32_t ID);
|
|
|
|
static std::vector<std::int32_t> GetIndicesOf(const std::string& Name);
|
2018-06-28 02:22:43 +00:00
|
|
|
static std::vector<std::int32_t> GetIndicesOf(const std::vector<std::int32_t>& IDs);
|
|
|
|
static std::vector<std::int32_t> GetIndicesOf(const std::vector<std::string>& Names);
|
2017-12-25 23:49:48 +00:00
|
|
|
|
|
|
|
static std::vector<Box> GetSlotBoxes();
|
|
|
|
static std::vector<Box> GetBoxesOf(std::int32_t ID);
|
|
|
|
static std::vector<Box> GetBoxesOf(const std::string& Name);
|
|
|
|
|
|
|
|
static bool Contains(std::int32_t ID);
|
|
|
|
static bool Contains(const std::string& Name);
|
2018-06-28 02:22:43 +00:00
|
|
|
static bool Contains(const Interactable::Item& Item);
|
2018-01-18 02:45:28 +00:00
|
|
|
static bool Contains(const std::vector<std::int32_t>& IDs); // true if all items are found at least once
|
|
|
|
static bool Contains(const std::vector<std::string>& Names); // true if all items are found at least once
|
2018-06-28 02:22:43 +00:00
|
|
|
static bool Contains(const std::vector<Interactable::Item>& Items);
|
2017-12-25 23:49:48 +00:00
|
|
|
|
|
|
|
static bool ContainsAny(const std::vector<std::int32_t>& IDs);
|
|
|
|
static bool ContainsAny(const std::vector<std::string>& Names);
|
2018-06-28 02:22:43 +00:00
|
|
|
static bool ContainsAny(const std::vector<Interactable::Item>& Items);
|
2017-12-25 23:49:48 +00:00
|
|
|
|
|
|
|
static bool ContainsOnly(std::int32_t ID);
|
|
|
|
static bool ContainsOnly(const std::string& Name);
|
2018-06-28 02:22:43 +00:00
|
|
|
static bool ContainsOnly(const Interactable::Item& Item);
|
2017-12-25 23:49:48 +00:00
|
|
|
static bool ContainsOnly(const std::vector<std::int32_t>& IDs);
|
|
|
|
static bool ContainsOnly(const std::vector<std::string>& Names);
|
2018-06-28 02:22:43 +00:00
|
|
|
static bool ContainsOnly(const std::vector<Interactable::Item>& Items);
|
|
|
|
|
|
|
|
static bool Use(std::int32_t ID, std::int32_t ID2 = -1, bool UseSecondFirst = false);
|
|
|
|
static bool Use(const std::string& Name, const std::string& Name2 = "", bool UseSecondFirst = false);
|
|
|
|
static bool Use(const Interactable::Item& Item, const Interactable::Item& Item2 = Interactable::Item(), bool UseSecondFirst = false);
|
|
|
|
|
|
|
|
static bool Equip(std::int32_t ID);
|
|
|
|
static bool Equip(const std::string& Name);
|
|
|
|
static bool Equip(const Interactable::Item& Item);
|
2017-12-25 23:49:48 +00:00
|
|
|
|
2018-06-28 02:22:43 +00:00
|
|
|
static bool Drop(std::int32_t ID, bool AllowShiftClick = true);
|
|
|
|
static bool Drop(const std::string& Name, bool AllowShiftClick = true);
|
|
|
|
static bool Drop(const Interactable::Item& Item, bool AllowShiftClick = true);
|
2017-12-25 23:49:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
#endif // INVENTORY_HPP_INCLUDED
|