diff --git a/src/c/player.c b/src/c/player.c index c789fed..3b3afef 100644 --- a/src/c/player.c +++ b/src/c/player.c @@ -14,4 +14,26 @@ Player addItemToInventory(Item *availableItems, int itemIndex, Player actualPlay actualPlayer.itemCounter += 1; return actualPlayer; +} + +void showInventory(Player actualPlayer) +{ + int inventoryItemCounter = actualPlayer.itemCounter; + + if (inventoryItemCounter == 0) + { + printf("*** Inventory is empty *** \n\n"); + } + else + { + printf("*** Inventory *** \n\n"); + + for (int i = 0; i < actualPlayer.itemCounter; i++) + { + // printf("%d: %d - %s\n", i, inventory[i].id, inventory[i].itemName); + printf("> %s - %d\n", actualPlayer.itemInventory[i].itemName, i); + } + } + + printf("\n\n"); } \ No newline at end of file diff --git a/src/c/player.h b/src/c/player.h index 25a69be..fdb704a 100644 --- a/src/c/player.h +++ b/src/c/player.h @@ -13,4 +13,6 @@ typedef struct Player addItemToInventory(Item *availableItem, int itemIndex, Player actualPlayer); +void showInventory(Player actualPlayer); + #endif \ No newline at end of file