#ifndef _HPP_KUNGFLOW_ENEMY
#define _HPP_KUNGFLOW_ENEMY

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

#include "defines.hpp"

#include "stageentity.hpp"

class KungFlowGame;
class PlayState;

enum e_EnemyType {
  e_EnemyType_Birdlike,
  e_EnemyType_Grenade,
  e_EnemyType_SIZE
};

class Enemy : public StageEntity {

  public:

    Enemy(const KungFlowGame *game, const PlayState *playState, e_EnemyType enemyType, e_Team team, const Vector2 &position = _DEFAULTVECTOR, float zPosition = 0, const Vector2 &movement = _DEFAULTVECTOR, float zMovement = 0);
    virtual ~Enemy();

    //static Enemy *SpawnEnemy(e_EnemyType enemyType, const Vector2 &position) const; // factory

    // in StageEntity:
    //virtual void GetBoundingCircle(Vector2 &center, Vector2 &radius) const = 0;
    //virtual void OnCollide(const StageEntity* entity) = 0;

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

    virtual Vector2 GetPosition() const override { return position; }
    virtual void SetPosition(const Vector2 &newPosition) override { this->position = newPosition; }
    virtual float GetZPosition() const override { return zPosition; }
    virtual void SetZPosition(float newZPosition) override { this->zPosition = newZPosition; }
    virtual Vector2 GetMovement() const override { return movement; }
    virtual void SetMovement(const Vector2 &newMovement) override { this->movement = newMovement; }
    virtual float GetZMovement() const override { return zMovement; }
    virtual void SetZMovement(float newZMovement) { zMovement = newZMovement; }
    //virtual float GetVelocity() const { return GetMovement().GetLength(); }
    virtual float GetWeight() const override { return 1.0f; }
    virtual float GetRadius() const override { return 0.5f; }
    virtual float GetHeight() const override { return 0.0f; }

    virtual float GetDamagePotentialFactor() const = 0;

    e_EnemyType GetEnemyType() const { return enemyType; }

  protected:

    const KungFlowGame *game;
    const PlayState *playState;

    e_EnemyType enemyType;

    Vector2 position;
    float zPosition;
    Vector2 movement;
    float zMovement;

};

#endif
