#include "Ship/Cargo.h"

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

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

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

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

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

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)
    : Cargo(amount), power(power) {}

size_t Alcohol::getPrice() const {
    return (power * BASE_PRICE) / MAX_POWER;
}

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

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