#include <Core/BasicPrintVisitor.h>

#include <Ship/Ship.h>
#include <Store/Store.h>
#include <iomanip>
#include <iostream>

void BasicPrintVisitor::visit(const Store& store) const {
    const auto& cargoes = store.cargoes();

    for (const auto& cargo : cargoes) {
        std::cout << std::setw(15) << std::left << cargo->name() << std::setw(15) << cargo->amount << std::setw(15) << cargo->getPrice() << "\n";
    }
}

void BasicPrintVisitor::visit(const Ship& ship) const {
    const auto& cargoes = ship.cargoes();

    for (const auto& cargo : cargoes) {
        std::cout << std::setw(15) << std::left << cargo->name() << std::setw(15) << cargo->amount << "\n";
    }
}
