#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_throwSphereAction;
    int m_throwObjectAction;

    Mesh* m_cubeMesh;
    btCollisionShape* m_cubeShape;
    float m_cubeMass;

    Mesh* m_sphereMesh;
    btCollisionShape* m_sphereShape;
    float m_sphereMass;

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

    void throwCube();
    void throwSphere();
    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_throwSphereAction = action; }
    void setObjectThrowingAction(int action) { m_throwObjectAction = action; }

    virtual void update();
};

#endif // POTATOR_H
