#ifndef SCENE_H
#define SCENE_H

#include <QGraphicsScene>
#include <QKeyEvent>
#include <QGraphicsTextItem>
#include <QTimer>
#include "donfedejugador.h"
#include "background.h"
#include "suelosimple.h"
#include "bottomhitbox.h"
#include "westhitbox.h"
#include "easthitbox.h"
#include "interactable.h"
#include "zombiesimple.h"
#include "proyectil.h"
#include "button.h"

class Scene : public QGraphicsScene
{
    Q_OBJECT
public:
    explicit Scene(QObject *parent = nullptr);
    virtual ~Scene();
    void addPlayer(int x, int y);
    void addBottomHB();
    void addTopHB();
    void addWestHB();
    void addEastHB();
    void connectPlayerHB();

    void addBackground(QPixmap);
    sueloSimple * addVerticalLevelBorders(int x, int y);
    sueloSimple * addHorizontalLevelBorders(int x, int y);

    sueloSimple * addFloorXYCoor(int x,int y);
    sueloSimple * addWallXYCoor(int x, int y);
    interactable * addDoorXYCoorType(int x, int y, int type);
    interactable * addPaltaXYCoorType(int x, int y, int type);
    interactable * addCatXYCoorType(int x, int y, int type);

    void setPlayer(int x, int y);
    void setStartScreen();
    void setTutorial();
    void setLevel1();

    zombieSimple *addBaseZombie(int x, int y);
    void connectProjectileZombie(proyectil * bala);

public slots:
    void cleanScene();

signals:

private:
    QList<QGraphicsPixmapItem*> punteros;
    QTimer * gameOverTimer;
    QGraphicsTextItem * puntos;
    donFedeJugador * jugador;
    bottomHitbox * botHB;
    topHitbox * topHB;
    westHitbox * westHB;
    eastHitbox * eastHB;
    background * fondo;
    bool leftPressed;
    bool rightPressed;
    int bulletAmount;
    int level;
    int puntosJugador;

    // QGraphicsScene interface
protected:
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);
};

#endif // SCENE_H
