You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
748 B

#include "StorageEditor.h"
StorageEditor::StorageEditor() { }
StorageEditor::StorageEditor(std::shared_ptr<WarenStorage> storage) {
this->storage = std::make_shared<WarenStorage>(new WarenStorage());
}
std::shared_ptr<WarenStorage> StorageEditor::getWarenStorage() const {
return storage;
}
void StorageEditor::setWarenStorage(const WarenStorage storage) {
this->storage = std::make_shared<WarenStorage>(storage);
}
void StorageEditor::addWaren(const Ware ware, int amount) {
for(auto i = 0; i < amount; i++) {
storage->addWareAndGenerateId(ware);
}
}
void StorageEditor::removeWaren(const std::string& name, const int amount) {
for(auto i = 0; i < amount; i++) {
storage->removeWare(name);
}
}