Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Cave-Crawler/inventory.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
76 lines (55 sloc)
1.06 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "inventory.h" | |
inv::inv() | |
{ | |
} | |
void inv::addArmour(int item, int itemID) | |
{ | |
} | |
void inv::addPotion(int item, int itemID) | |
{ | |
} | |
void inv::addItem(int itemType, int item, int itemID) | |
{ | |
Inv.push_back(new item); | |
if (itemType == 0) // questuri | |
{ | |
addQItem(item, itemID); | |
} | |
if (itemType == 1) // weapon | |
{ | |
addArma(item, itemID); | |
} | |
if (itemType == 2) // armours | |
{ | |
addArmour(item, itemID); | |
} | |
if (itemType == 3) // potion | |
{ | |
addPotion(item, itemID); | |
} | |
} | |
void inv::addQItem(int item, int itemID) | |
{ | |
} | |
void inv::addArma(int item, int itemID) | |
{ | |
if (item == 0) // unarmed | |
{ | |
} | |
if (item == 1) // daggers | |
{ | |
} | |
if (item == 2) // swords | |
{ | |
sabie getsabie; | |
getSword.getsabieName(itemID, Inv.back()->itemName); | |
getSword.getsabiePrices(itemID, Inv.back()->cost, Inv.back()->value); | |
getSword.getsabieStats(itemID, Inv.back()->attackRates, Inv.back()->dmg); | |
delete &getsabie; | |
} | |
} | |
void inv::removeItem(unsigned short int b) | |
{ | |
delete Inv.at(b); | |
Inv.erase(Inv.begin() + b); | |
} |