From 30fd2261692447439bb54682fe09efb2629a09dc Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Mar 2022 02:32:14 +0200 Subject: [PATCH] remove unneccessary this-> prefixes --- src/StorageEditor/StorageEditor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/StorageEditor/StorageEditor.cpp b/src/StorageEditor/StorageEditor.cpp index b5bbcf4..51898dd 100644 --- a/src/StorageEditor/StorageEditor.cpp +++ b/src/StorageEditor/StorageEditor.cpp @@ -2,29 +2,29 @@ StorageEditor::StorageEditor() { } -StorageEditor::StorageEditor(const std::shared_ptr storage) { - this->storage = storage; +StorageEditor::StorageEditor(std::shared_ptr storage) { + this->storage = std::make_shared(new WarenStorage()); } -WarenStorage StorageEditor::getWarenStorage() const { +std::shared_ptr StorageEditor::getWarenStorage() const { return storage; } void StorageEditor::setWarenStorage(const WarenStorage storage) { - this->storage = storage; + this->storage = std::make_shared(storage); } void StorageEditor::addWaren(const Ware ware, int amount) { for(auto i = 0; i < amount; i++) { - storage.addWareAndGenerateId(ware); + storage->addWareAndGenerateId(ware); } } void StorageEditor::removeWaren(const std::string& name, const int amount) { for(auto i = 0; i < amount; i++) { - storage.removeWare(name); + storage->removeWare(name); } }