19 #ifndef OPENXCOM_RULEINVENTORY_H
20 #define OPENXCOM_RULEINVENTORY_H
25 #include <yaml-cpp/yaml.h>
35 enum InventoryType { INV_SLOT, INV_HAND, INV_GROUND };
50 std::vector<RuleSlot> _slots;
51 std::map<std::string, int> _costs;
54 static const int SLOT_W = 16;
55 static const int SLOT_H = 16;
56 static const int HAND_W = 2;
57 static const int HAND_H = 3;
63 void load(
const YAML::Node& node,
int listOrder);
65 std::string
getId()
const;
73 std::vector<struct RuleSlot> *
getSlots();
80 int getListOrder()
const;
std::string getId() const
Gets the inventory's id.
Definition: RuleInventory.cpp:85
~RuleInventory()
Cleans up the inventory ruleset.
Definition: RuleInventory.cpp:60
int getCost(RuleInventory *slot) const
Gets a certain cost in the inventory.
Definition: RuleInventory.cpp:231
InventoryType getType() const
Gets the inventory type.
Definition: RuleInventory.cpp:115
int getX() const
Gets the X position of the inventory.
Definition: RuleInventory.cpp:94
Definition: RuleInventory.h:30
RuleInventory(const std::string &id)
Creates a blank inventory ruleset.
Definition: RuleInventory.cpp:56
Represents a specific type of item.
Definition: RuleItem.h:41
bool checkSlotInPosition(int *x, int *y) const
Checks for a slot in a certain position.
Definition: RuleInventory.cpp:135
bool fitItemInSlot(RuleItem *item, int x, int y) const
Checks if an item fits in a slot.
Definition: RuleInventory.cpp:187
std::vector< struct RuleSlot > * getSlots()
Gets all the slots in the inventory.
Definition: RuleInventory.cpp:124
int getY() const
Gets the Y position of the inventory.
Definition: RuleInventory.cpp:103
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:44