/*
 * DisplayWorld.h
 *
 *  Created on: 21 févr. 2017
 *      Author: sylvain
 */

#ifndef GAMECONTROLLER_H_
#define GAMECONTROLLER_H_

#include "GameView.h"
#include "Link.h"
#include "Monster.h"
#include "StatView.h"
#include <QWidget>
#include <QList>
#include <QPainter>
#include <QObject>
#include <QEvent>
#include<iostream>
#include <QDebug>
#include <QApplication>

//Gestion déplacements Link: les bool sont à true si la touche est actuellement enfoncée
struct linkStruct
{
    bool L;
    bool R;
    bool U;
    bool D;
    bool A;
    bool B;
};

class GameController: public QObject {

    Q_OBJECT

public:
    GameController();
    virtual ~GameController();
    QGraphicsView *getWidget(void);
    void gameLoop();
    GameView gameView;
    StatView statView;
    linkStruct linkMoves;

public slots:
    void goAttackA();
    void stopAttackA();
    void goAttackB();
    void stopAttackB();
    void goLeft();
    void goRight();
    void goUp();
    void goDown();
    void stopLeft();
    void stopRight();
    void stopUp();
    void stopDown();

protected:
    Link *link;
    QList<Monster*> *monsters;
    float score;
    float timer;
    float monsterTimer;
    bool inGame;

};
#endif /* GAMECONTROLLER_H_ */
