4 #define INVENTORY_SIZE 10
void useEquippedItem(State *st)
Uses the equipped item.
Definition: inventory.c:194
void sellEquippedItem(State *st, Inventory *i)
Sells the equipped item.
Definition: inventory.c:100
void switchEquippedItem(Inventory *i)
Switches the equipped item on a inventory.
Definition: inventory.c:141
void addItem(Inventory *i, Item *item)
Adds an item to the inventory.
Definition: inventory.c:39
Inventory * initInventory()
Initializes a new inventory. Allocates memory for a new inventory and initializes its fields.
Definition: inventory.c:17
void removeItem(Inventory *i, Item *item)
Removes an item from the inventory.
Definition: inventory.c:68
void freeInventory(void *p)
Frees the memory allocated for an inventory.
Definition: inventory.c:173
struct inventory Inventory
Inventory structure represents the player inventory.
Inventory structure represents the player inventory.
Definition: inventory.h:26
Item * equipped_item
Definition: inventory.h:30
int equiped_index
Definition: inventory.h:31
int gold
Definition: inventory.h:36
int nr_items
Definition: inventory.h:28
Item ** items
Definition: inventory.h:27
Item * equipped_sword
Definition: inventory.h:33
Item * equipped_armor
Definition: inventory.h:34
Item structure represents an item in the game.
Definition: item.h:28
Sructure of the game state.
Definition: state.h:38