//filename: inventory.h //Contains the declaration of the functions from the inventory class, which represents the items the player is carrying in the form of a dynamic array. //Item accepts new items from the Monster class upon the player 'beating' the room, and allows the player to change which item they have equipped through the Player class. #ifndef INVENTORY_H #define INVENTORY_H #include //for output #include #include #include "Item.h" using namespace std; class Inventory{ private: vector inventory; int equipped; // holds the index of the item currently equipped public: //Constructs a new Inventory class. Inventory(); //Accepts a string and three ints from the Monster class, and adds it into the 'array' of inventory. void gainItem(string lootName, int lootFight, int lootTalk){ Item newItem(lootName, lootFight, lootTalk); inventory.push_back(newItem); } //returns the fight attribute of the equipped item int getEquippedFight(){ return inventory.at(equipped).getFight(); } //returns the talk attribute of the equipped item int getEquippedTalk(){ return inventory.at(equipped).getTalk(); } //sets the equipped item to the index given by the player. void setEquipped(int selection){ equipped = selection; } //Outputs your inventory line-by-line. void listInventory(); }; #endif // INVENTORY_H