#include <Core/FullInfoPrintVisitor.h>

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

void FullInfoPrintVisitor::visit(const Store& store) const {
    std::cout << "Don't have time to implement this, sorry xD\n";
}

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

    std::cout << "|----------------|----------------|----------------|\n";
    std::cout << "|      NAME      "
              << "|     AMOUNT     "
              << "|     PRICE      |" << '\n';
    std::cout << "|----------------|----------------|----------------|\n";
    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";
    }
    std::cout << "|----------------|----------------|----------------|\n";
}
