Esempio n. 1
0
void inventory::addWeightAndCount(itemNode* node, const item& newItem) {
    if(newItem.getWeight() == node->getWeight()) {
        node->incrementCount();
        _weight += newItem.getWeight();
        _count++;
        newItem.printSuccess();
    }

    else {
        std::cout << "ERROR: tried to add a duplicate item "
                  << "with wrong weight!\n";
    }
    return;
}