diff --git a/src/InputManager/InputManager.cpp b/src/InputManager/InputManager.cpp index fafd6fc..98cced5 100644 --- a/src/InputManager/InputManager.cpp +++ b/src/InputManager/InputManager.cpp @@ -2,7 +2,7 @@ #include #include -InputManager::InputManager(StorageEditor storageEditor) { +InputManager::InputManager(std::shared_ptr storageEditor) { this->editor = storageEditor; } @@ -91,16 +91,16 @@ void InputManager::displayMainMenu() { switch(selectedOption) { case 1: { InputManager::WareAndAmount x = displayAddWareDialog(); - editor.addWaren(x.ware, x.amount); + editor->addWaren(x.ware, x.amount); break; } case 2: { InputManager::WareAndAmount x = displayRemoveWareDialog(); - editor.removeWaren(x.ware.getName(), x.amount); + editor->removeWaren(x.ware.getName(), x.amount); break; } case 3: { - std::vector waren = this->editor.getWarenStorage().getAllWaren(); + std::vector waren = this->editor->getWarenStorage().getAllWaren(); displayWaren(waren); break; } diff --git a/src/InputManager/InputManager.h b/src/InputManager/InputManager.h index 6db4fdc..24ecc10 100644 --- a/src/InputManager/InputManager.h +++ b/src/InputManager/InputManager.h @@ -1,5 +1,6 @@ #include "../pch.h" #include "../StorageEditor/StorageEditor.h" +#include class InputManager { @@ -7,7 +8,7 @@ class InputManager { typedef int MenuOption; private: - StorageEditor editor; + std::shared_ptr editor; MenuOption selectedOption; @@ -22,7 +23,7 @@ class InputManager { public: - InputManager(StorageEditor storageEditor); + InputManager(std::shared_ptr storageEditor); void displayMainMenu();