#ifndef BATTERY_HPP_
#define BATTERY_HPP_

#include <Item/StatefulItem/StatefulItem.hpp>
#include <Serialize/Serialize.hpp>
#include <Material/Material.hpp>
#include <World/World.hpp>
#include <Item/IEnergyContainingItem.hpp>
#include <Item/IChemicalReactorComponent.hpp>

/**
 * @brief The battery item.
 */
class Battery :
    public StatefulItem<int>,
    public IEnergyContainingItem,
    public IChemicalReactorComponent
{
public:
    static constexpr int capacity = 5000;

    Battery(std::string name);

    virtual void draw(GraphicsContext &context, int x, int y, const ItemStack &stack) override;
    virtual std::string getDisplayName(const ItemStack &stack) override;
    virtual void draw3D(GraphicsContext &context, WorldDisplay &worldDisplay, glm::vec3 pos, ItemStack &stack) override;
    virtual void drawFlat(GraphicsContext &context, WorldDisplay &worldDisplay, glm::mat4 matrix, ItemStack &stack) override;
    virtual void getExtraToolTipLines(const ItemStack &stack, ToolTip &tip) override;
    virtual bool canMerge(const ItemStack &a, const ItemStack &b) override;
    virtual int pullEnergy(ItemStack &stack, int energy) override;
    virtual int pushEnergy(ItemStack &stack, int energy) override;
    virtual void describeInChemicalReactor(ItemStack &stack, std::ostream &os) override;
    virtual void updateChemicalReactor(ItemStack &stack, MChemicalReactor &reactor) override;
    virtual void onMovedBy(Player &player, const ItemStack &stack) override;
    virtual void getCheatStacks(ItemStack &baseStack, std::vector<ItemStack> &outStacks) override;
};

#endif