#ifndef POTATOR_H
#define POTATOR_H

#include "scene/gibgeneratornode.h"
#include "SparrowInput/input.h"

class PlayerCharacterNode;
class Mesh;

class Potator : public GibGeneratorNode
{
    PlayerCharacterNode *m_player;
    int m_throwCubeAction;
    int m_throwBottleAction;
    int m_throwObjectAction;

    Mesh* m_cubeMesh;
    btCollisionShape* m_cubeShape;
    float m_cubeMass;

    std::vector<Mesh*> m_bottleMeshes;
    btCollisionShape* m_bottleShape;
    float m_bottleMass;

    std::vector<Mesh*> m_swordMeshes;
    btCollisionShape* m_swordShape;
    float m_swordMass;

    void throwCube();
    void throwBottle();
    void throwSword();

public:
    Potator(PlayerCharacterNode * player = nullptr,
            int cube_action = NO_ACTION,
            int sphere_action = NO_ACTION,
            int object_action = NO_ACTION);

    void setPlayer(PlayerCharacterNode *player) { m_player = player; }

    void setCubeThrowingAction(int action) { m_throwCubeAction = action; }
    void setSphereThrowingAction(int action) { m_throwBottleAction = action; }
    void setObjectThrowingAction(int action) { m_throwObjectAction = action; }

    virtual void update();
};

#endif // POTATOR_H
