23 #include <yaml-cpp/yaml.h> 33 enum InventoryType { INV_SLOT, INV_HAND, INV_GROUND };
48 std::vector<RuleSlot> _slots;
49 std::map<std::string, int> _costs;
52 static const int SLOT_W = 16;
53 static const int SLOT_H = 16;
54 static const int HAND_W = 2;
55 static const int HAND_H = 3;
61 void load(
const YAML::Node& node,
int listOrder);
63 std::string
getId()
const;
71 std::vector<struct RuleSlot> *
getSlots();
78 int getListOrder()
const;
bool checkSlotInPosition(int *x, int *y) const
Checks for a slot in a certain position.
Definition: RuleInventory.cpp:135
~RuleInventory()
Cleans up the inventory ruleset.
Definition: RuleInventory.cpp:60
Definition: RuleInventory.h:28
bool fitItemInSlot(RuleItem *item, int x, int y) const
Checks if an item fits in a slot.
Definition: RuleInventory.cpp:187
int getY() const
Gets the Y position of the inventory.
Definition: RuleInventory.cpp:103
RuleInventory(const std::string &id)
Creates a blank inventory ruleset.
Definition: RuleInventory.cpp:56
InventoryType getType() const
Gets the inventory type.
Definition: RuleInventory.cpp:115
Represents a specific type of item.
Definition: RuleItem.h:40
int getCost(RuleInventory *slot) const
Gets a certain cost in the inventory.
Definition: RuleInventory.cpp:231
std::vector< struct RuleSlot > * getSlots()
Gets all the slots in the inventory.
Definition: RuleInventory.cpp:124
int getX() const
Gets the X position of the inventory.
Definition: RuleInventory.cpp:94
std::string getId() const
Gets the inventory's id.
Definition: RuleInventory.cpp:85
Definition: BaseInfoState.cpp:40
void load(const YAML::Node &node, int listOrder)
Loads inventory data from YAML.
Definition: RuleInventory.cpp:69
Represents a specific section of the inventory, containing information like available slots and scree...
Definition: RuleInventory.h:42