#ifndef COMBUSTION_GENERATOR_CONTROLLER_HPP_
#define COMBUSTION_GENERATOR_CONTROLLER_HPP_

#include <memory>
#include <string>

#include <Controller/InventoryController/InventoryController.hpp>
#include <Machine/MCombustionGenerator/MCombustionGenerator.hpp>

/**
 * @brief The combustion generator controller.
 */
class CombustionGeneratorController : public InventoryController
{
private:
    std::string waterName;
    std::string petrolName;

    std::shared_ptr<MCombustionGenerator> combustionGenerator;
    bool isSwitchedOn = false;
    int petrolLevel = 0;
    int storedEnergy = 0;

    Command<uint32_t, bool, int, int> updateCombustionGeneratorState;
    Command<uint32_t, bool> setSwitch;

    static glm::ivec4 petrolHighlightColor;

public:
    CombustionGeneratorController(ControllerChannel &channel);

    void onConnect(std::shared_ptr<Machine> combustionGeneratorMachine);

    virtual Widget* getRightPanel() override;
    virtual void update() override;
    virtual glm::vec4 getSlotHighlight(const std::string &id, int slot, ItemStack &stack) override;
};

#endif
