#ifndef MDYNAMO_HPP_
#define MDYNAMO_HPP_

#include <Machine/Machine.hpp>
#include <Machine/IElectricMachine.hpp>

/**
 * @brief The "dynamo" machine.
 */
class MDynamo :
    public Machine,
    public IElectricMachine
{
public:
    static constexpr int energyPerClick = 5;
    
    MDynamo(LocalWorld &world, glm::ivec3 pos);

    /**
     * @brief Generate the 5J from interacting with the dynamo.
     */
    void recharge();

    virtual void serializeState(std::vector<uint8_t> &outBytes) override;
    virtual void deserializeState(const uint8_t *data, size_t size) override;
    virtual bool canConnectElectricWire(Side side) override;
    virtual bool canDrainEnergyFromSide(Side side) override;
    virtual void onEnergyDrained(int amount) override;
};

#endif