#include "Ship/Cargo.h"

Cargo::Cargo(size_t amount)
    : amount(amount) {}

size_t Fruit::getPrice() const {
    return 20;
}

const std::string& Fruit::name() const {
    static std::string name{"Banana"};
    return name;
}

Fruit::Fruit(size_t amount, int rottenCounter)
    : Cargo(amount), rottenCounter(rottenCounter) {
}

void Fruit::accept(const CargoDamageVisitor& visitor) {
    visitor(*this);
}

Item::Item(size_t amount, Type type)
    : Cargo(amount), type(type) {
}

size_t Item::getPrice() const {
    return 30;
}

const std::string& Item::name() const {
    static std::string name{"Item"};
    return name;
}

void Item::accept(const CargoDamageVisitor& visitor) {
    visitor(*this);
}

Alcohol::Alcohol(size_t amount, int power, Type type)
    : Cargo(amount), power(power), type(type) {}

size_t Alcohol::getPrice() const {
    return 40;
}

const std::string& Alcohol::name() const {
    static std::string name{"Rum"};
    return name;
}

void Alcohol::accept(const CargoDamageVisitor& visitor) {
    visitor(*this);
}
