#include "StorageEditor.h" StorageEditor::StorageEditor() { } StorageEditor::StorageEditor(std::shared_ptr storage) { this->storage = storage; } std::shared_ptr StorageEditor::getWarenStorage() const { return storage; } void StorageEditor::setWarenStorage(const WarenStorage storage) { //move might be unnecessary here this->storage = std::make_shared(std::move(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); } }