#ifndef OIL_REFINERY_CONTROLLER_HPP_
#define OIL_REFINERY_CONTROLLER_HPP_

#include <memory>

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

/**
 * @brief The 'oil refinery' controller.
 */
class OilRefineryController : public InventoryController
{
private:
    std::shared_ptr<MOilRefinery> m_oilRefinery;
    bool isSwitchedOnPriv = false;
    int m_oilAmount = 0;
    int m_petrolAmount = 0;
    int m_storedEnergy = 0;

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

public:
    OilRefineryController(ControllerChannel &channel);

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

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

#endif