#pragma once

#include <memory>
#include <string>
#include <vector>

#include "Ship/Cargo.h"

class Ship {
public:
    enum class StatusCode {
        OK,
        MissingCargo,
        LackOfSpace
    };

    Ship(const std::string& name, int capacity);

    std::string& name() { return _name; }
    const std::string& name() const { return _name; }

    Cargo* load(std::unique_ptr<Cargo>&& cargo, StatusCode& code) noexcept;
    void unload(const Cargo& cargo, StatusCode& code) noexcept;

    // May throw
    Cargo* load(std::unique_ptr<Cargo>&& cargo);
    void unload(const Cargo& cargo);

private:
    std::string _name;
    int _capacity;
    std::vector<std::unique_ptr<Cargo>> _cargoes;
};
