~mzanetti/machines-vs-machines/qmake-based

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
42
43
44
45
46
#ifndef LEVEL_H
#define LEVEL_H

#include "wave.h"

#include <QObject>

class Level : public QObject
{
    Q_OBJECT
    Q_PROPERTY(int startMoney READ startMoney CONSTANT)
    Q_PROPERTY(int rows READ rows CONSTANT)
    Q_PROPERTY(int columns READ columns CONSTANT)
    Q_PROPERTY(int rewardPoints READ rewardPoints )
    Q_PROPERTY(QList<int> fieldsOnPath READ fieldsOnPath)

    Q_PROPERTY(int highscore READ highscore NOTIFY highscoreChanged)

public:
    explicit Level(const QVariantMap &levelMap, QObject *parent = 0);

    int startMoney() const;
    int rows() const;
    int columns() const;
    QList<int> fieldsOnPath() const;
    int rewardPoints() const;
    QList<Wave> waves() const;

    int highscore() const;
    void setHighscore(int highscore);

signals:
    void highscoreChanged();

private:
    int m_startMoney;
    int m_rows;
    int m_columns;
    QList<int> m_fieldsOnPath;
    int m_rewardPoints;
    QList<Wave> m_waves;

    int m_highscore;
};

#endif // LEVEL_H