#ifndef _HPP_KUNGFLOW_ENEMY_GRENADE
#define _HPP_KUNGFLOW_ENEMY_GRENADE

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

#include "enemy.hpp"

class Position3D;

class EnemyGrenade : public Enemy {

  public:

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

    //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;

    virtual float GetWeight() const override { return 0.2f; }
    virtual float GetRadius() const override { return radius; }
    virtual float GetHeight() const override { return 0.4f; } // unrealistically high, but makes it easier to hit

    virtual float GetDamagePotentialFactor() const override;

  protected:

    void _Init();

    Object *bodyObject;
    Sprite *bodySprite;

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

    bool hit;
    //unsigned int hitPause_ms;
    float intensity;
    float radius;

    unsigned int timeSinceSpawn_ms;
    unsigned int lifeTime_ms;

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

};

#endif
