#ifndef _HPP_KUNGFLOW_ENTITY_MIXTAPE
#define _HPP_KUNGFLOW_ENTITY_MIXTAPE

#include "gaia/gaia.hpp"
using namespace gaia;

#include "defines.hpp"

#include "genericentity.hpp"

class KungFlowGame;
class PlayState;
class Position3D;

class Mixtape : public GenericEntity {

  public:

    Mixtape(const KungFlowGame *game, const PlayState *playState, const Vector2 &position = _DEFAULTVECTOR, float zPosition = 0, const Vector2 &movement = _DEFAULTVECTOR, float zMovement = 0);
    Mixtape(const KungFlowGame *game, const PlayState *playState, const std::vector<Position3D> &trajectory);
    virtual ~Mixtape();

    //virtual void GetSpriteBounds(Vector2 &center, Vector2 &radius) const override;
    virtual void OnCollide(const StageEntity* entity) override;

    virtual void OnStepPhysicsTime() override;
    virtual void PostStepPhysicsTime() override;
    virtual void Draw(const Viewport &viewport, const Camera &camera) const override;

    // resets timeSinceLastThrow_ms!
    void SetTrajectory(const std::vector<Position3D> &trajectory);

    virtual float GetWeight() const override { return 0.1f; }
    virtual float GetRadius() const override { return 0.2f; }
    virtual float GetHeight() const override { return 0.4f; }
    virtual bool IsThrowable() const override { return true; }

  protected:

    void _Init();

    Object *bodyObject;
    Sprite *bodySprite;

    e_PhysicsMode physicsMode;
    std::vector<Position3D> trajectory;

    bool hit;

    unsigned int timeSinceLastThrow_ms;

    Vector2 queuedPosition;
    float queuedZPosition;
    Vector2 queuedMovement;
    float queuedZMovement;

};

#endif
