summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/errorstate/mainwindow.h
blob: 2bd574d12991d0a8a4798b9137dcdb4e2c2f45e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTime>

class QGraphicsScene;
class QStateMachine;
class QState;
class TankItem;
class MainWindow: public QMainWindow
{
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
    void addTank();
    void runStep();

signals:
    void gameOver();
    void mapFull();

private:
    void init();
    void addWall(const QRectF &wall);

    QGraphicsScene *m_scene;
    
    QStateMachine *m_machine;
    QState *m_runningState;

    QList<TankItem *> m_spawns;
    QTime m_time;

};

#endif