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

    std::vector<Mesh*> m_shieldMeshes;
    btCollisionShape* m_shieldShape;
    float m_shieldMass;

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

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

    void throwShield();
    void throwBottle();
    void throwSword();

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

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

    void setShieldThrowingAction(int action) { m_throwShieldAction = action; }
    void setSphereThrowingAction(int action) { m_throwBottleAction = action; }
    void setObjectThrowingAction(int action) { m_throwObjectAction = action; }

    virtual void update();
};

#endif // POTATOR_H
