#ifndef HERO_H
#define HERO_H

#include "Case.h"
#include "Level.h"
#include "Kraken.h"

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>

#include <string>
#include <vector>

#define TILE_WIDTH 30
#define TILE_HEIGHT 30


class Hero
{
    public:
        Hero(Kraken* kraken, float pozX, float pozY);
        virtual ~Hero();

        void SetspeedX(float val) { m_speedX = val; }

        void SetspeedY(float val) { m_speedY = val; }

        float GetpozX() { return m_pozX; }
        void SetpozX(float val) { m_pozX = val; }

        float GetpozY() { return m_pozY; }
        void SetpozY(float val) { m_pozY = val; }

        void Setattacking(bool val) { m_attacking = val; }

        void Settexture(std::string name);
  
        /// // /// /// // /// // /// // ///
        void draw();
        void update();
        bool attack();
        void justMove();
        void die();
        int convertCoordX(float a) {return int(a/TILE_WIDTH);}
        int convertCoordY(float a) {return int(a/TILE_HEIGHT);}
        int next(float a, float b){return m_kraken->Getlevel()->getCoord(convertCoordX(a),convertCoordY(b))-'0';}
        void restartClock() {m_clock.restart();}
        bool isDead() {return m_dead;}


    protected:
        float m_speedX;
        float m_speedY;
        float m_pozX;
        float m_pozY;
        bool m_attacking;
        bool hasAttacked;
        bool underWater;
        sf::Vector2f m_start;
        sf::Texture m_texture;
        sf::Sprite m_sprite;
        int m_statut;
        Kraken* m_kraken;
        bool hidden;
        bool m_dead;
        int m_color;
        sf::CircleShape circle;
        float test;
        sf::Clock m_clock;
};

#endif // HERO_H
