#include <Ship/CargoDamageVisitor.h>

#include <Ship/Cargo.h>

std::random_device CargoDamageVisitor::_rd{};

void CargoDamageVisitor::operator()(Fruit& fruit) const {
    std::uniform_int_distribution<int> dice(0, 5);
    fruit.amount -= dice(_seed);
}

void CargoDamageVisitor::operator()(Alcohol& alcohol) const {
    std::uniform_int_distribution<int> dice(0, 10);
    alcohol.amount -= (dice(_seed) / 2);
}

void CargoDamageVisitor::operator()(Item& item) const {
    std::uniform_int_distribution<int> dice(0, 20);
    item.amount -= (dice(_seed) / 4);
}
