Commit aae0a7fb authored by Milwaukee Davis's avatar Milwaukee Davis
Browse files

Delete item.cpp in order to implement Inventory class cleanly

parent a3c778b2
//filename: item.cpp
//Contains the implementation of the more complicated functions from the item class, which represents the items the player is carrying in the form of several dynamic arrays.
#include <iostream> //for output
#include <vector>
#include "item.h"
using namespace std;
//Constructs a new Item class.
Item::Item(){
equipped = 0;
}
//Accepts a string and three ints from the Monster class, and adds it into the 'array' of inventory.
void Item::gainItem(string lootName, int lootFight, int lootFlee , int lootTalk){
itemName.push_back(lootName);
itemFight.push_back(lootFight);
itemFlee.push_back(lootFlee);
itemTalk.push_back(lootTalk);
}
//outputs the inventory array
void Item::listInventory(){
for(int i = 0; i < itemName.size(); i++){
cout << itemName.at(i) << ": Fight: " << itemFight.at(i) << " Flee: "<< itemFlee.at(i) << " Talk: " << itemTalk.at(i) << endl;
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment