|
|
@ -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"); |
|
|
|
} |