#ifndef IEQUIPMENT_HPP_
#define IEQUIPMENT_HPP_

#include <Item/IFluidContainingItem.hpp>
#include <Serialize/Serialize.hpp>
#include <Widget/Widget.hpp>
#include <cstdint>

class ItemStack;
class Player;

/**
 * @brief Interface implemented by items that can be equipped.
 */
class IEquipment
{
public:
    enum class MapLevel : uint8_t
    {
        None,
        CarvedMap,
        PaperMap,

        // This must always be the highest level.
        Cheat,
    };

    virtual ~IEquipment() = default;

    /**
     * @brief Return the map level provided by this item if equipped.
     * 
     * Returns `None` by default.
     */
    virtual MapLevel getMapLevel();

    /**
     * @brief Try to use one unit of fuel, and return the generated thrust.
     */
    virtual float generateThrust(ItemStack &stack);

    /**
     * @brief Try to use one unit and return the generated acceleration.
     */
    virtual float generateAcceleration(ItemStack &stack);

    /**
     * @brief Pull the specified amount of fluid for refilling an equipment.
     */
    virtual int pullFluidForEquipment(ItemStack &stack, std::string fluidName, int maxAmount);

    /**
     * @brief Called on each update while equipped by a player.
     */
    virtual void onPlayerUpdating(Player &player, ItemStack &stack);

    /**
     * @brief Returns the ID of the controller responsible for the gadget.
     * 
     * If this returns the empty string (the default), then this item does not show a gadget
     * when equipped.
     */
    virtual std::string getGadgetControllerID();
};

DERIVE_STATIC_CAST_SERIALIZER(IEquipment::MapLevel, uint8_t);

#endif