Snake/back-end/controller.h

30 lines
461 B
C
Raw Normal View History

2018-09-11 20:10:37 +03:00
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <QObject>
2018-10-30 21:23:41 +03:00
#include <QTimer>
#include <QTime>
2018-09-11 20:10:37 +03:00
#include "snake.h"
2018-09-27 14:59:10 +03:00
#include "world.h"
2018-09-11 20:10:37 +03:00
class Controller : public QObject
{
2018-10-11 00:04:52 +03:00
Q_OBJECT
2018-10-11 18:09:35 +03:00
Q_PROPERTY(QPoint deviceSize WRITE setDeviceSize)
2018-09-11 20:10:37 +03:00
private:
2018-09-27 14:59:10 +03:00
World world;
2018-10-30 21:23:41 +03:00
QTimer *timer;
2018-09-27 14:59:10 +03:00
2018-09-11 20:10:37 +03:00
public:
Controller();
void update();
2018-10-30 21:23:41 +03:00
void startTimer();
void stopTimer();
2018-10-11 18:09:35 +03:00
public slots:
void setDeviceSize(QPoint deviceSize);
2018-09-11 20:10:37 +03:00
};
#endif // CONTROLLER_H