#pragma once

#include <cstddef>
#include <string>

#include "Ship/CargoDamageVisitor.h"

#include <Core/DifficultLvlStrategy.h>

struct Cargo {
    size_t amount;

    Cargo(size_t amount);
    virtual ~Cargo() = default;
    Cargo(const Cargo&) = default;
    Cargo(Cargo&&) = default;
    Cargo& operator=(const Cargo&) = default;
    Cargo& operator=(Cargo&&) = default;

    auto operator<=>(const Cargo&) const = default;

    virtual size_t getPrice() const = 0;
    virtual const std::string& name() const = 0;
    virtual void accept(const CargoDamageVisitor& visitor) = 0;
};

struct Fruit : public Cargo {
    int rottenCounter;

    Fruit(size_t amount, int rottenCounter);

    size_t getPrice() const override;
    const std::string& name() const override;
    void accept(const CargoDamageVisitor& visitor) override;
};

struct Item : public Cargo {
    enum class Type { Common, Rare, Epic, Legendary };
    Type type;

    Item(size_t amount, Type type);

    size_t getPrice() const override;
    const std::string& name() const override;
    void accept(const CargoDamageVisitor& visitor) override;
};

struct Alcohol : public Cargo {
    enum class Type { White, Spiced, Dark};

    int power;
    Type type;

    Alcohol(size_t amount, int power, Type type);

    size_t getPrice() const override;
    const std::string& name() const override;
    void accept(const CargoDamageVisitor& visitor) override;
};