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
636 B

2 years ago
  1. #include "StorageEditor.h"
  2. StorageEditor::StorageEditor() { }
  3. StorageEditor::StorageEditor(const WarenStorage storage) {
  4. this->storage = storage;
  5. }
  6. WarenStorage StorageEditor::getWarenStorage() const {
  7. return storage;
  8. }
  9. void StorageEditor::setWarenStorage(const WarenStorage storage) {
  10. this->storage = storage;
  11. }
  12. void StorageEditor::addWaren(const Ware ware, int amount) {
  13. for(auto i = 0; i < amount; i++) {
  14. storage.addWareAndGenerateId(ware);
  15. }
  16. }
  17. void StorageEditor::removeWaren(std::string name, const int amount) {
  18. for(auto i = 0; i < amount; i++) {
  19. storage.removeWare(name);
  20. }
  21. }