qmlFrontend/hwengine.h
author unc0rr
Sat, 01 Nov 2014 22:51:07 +0300
branchqmlfrontend
changeset 10450 bf9e30b4ef9b
parent 10448 4cb727e029fa
child 10452 03519fd9f98d
permissions -rw-r--r--
- Store index of color instead of its value - Reset game config when switching pages
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
     1
#ifndef HWENGINE_H
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
     2
#define HWENGINE_H
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
     3
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
     4
#include <QObject>
10416
1c301054694d - Remove --port command
unc0rr
parents: 10402
diff changeset
     5
#include <QByteArray>
1c301054694d - Remove --port command
unc0rr
parents: 10402
diff changeset
     6
#include <QVector>
10420
unc0rr
parents: 10418
diff changeset
     7
#include <QPixmap>
10416
1c301054694d - Remove --port command
unc0rr
parents: 10402
diff changeset
     8
1c301054694d - Remove --port command
unc0rr
parents: 10402
diff changeset
     9
#include "flib.h"
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    10
10420
unc0rr
parents: 10418
diff changeset
    11
class QQmlEngine;
unc0rr
parents: 10418
diff changeset
    12
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    13
class HWEngine : public QObject
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    14
{
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    15
    Q_OBJECT
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    16
public:
10420
unc0rr
parents: 10418
diff changeset
    17
    explicit HWEngine(QQmlEngine * engine, QObject *parent = 0);
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    18
    ~HWEngine();
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    19
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    20
    static void exposeToQML();
10428
7c25297720f1 More refactoring: move PoC preview getting code into flib
unc0rr
parents: 10426
diff changeset
    21
    Q_INVOKABLE void getPreview();
10432
b0abef0ee78c Quick Game PoC
unc0rr
parents: 10430
diff changeset
    22
    Q_INVOKABLE void runQuickGame();
10448
4cb727e029fa - Allow to delete teams from config
unc0rr
parents: 10444
diff changeset
    23
    Q_INVOKABLE void runLocalGame();
10424
4be6cd55f1cf - Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents: 10420
diff changeset
    24
    Q_INVOKABLE QString currentSeed();
10442
c58db813240b Load and show local teams list
unc0rr
parents: 10434
diff changeset
    25
    Q_INVOKABLE void getTeamsList();
10450
bf9e30b4ef9b - Store index of color instead of its value
unc0rr
parents: 10448
diff changeset
    26
    Q_INVOKABLE void resetGameConfig();
10444
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    27
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    28
    Q_INVOKABLE void tryAddTeam(const QString & teamName);
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    29
    Q_INVOKABLE void tryRemoveTeam(const QString & teamName);
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    30
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    31
signals:
10420
unc0rr
parents: 10418
diff changeset
    32
    void previewImageChanged();
10442
c58db813240b Load and show local teams list
unc0rr
parents: 10434
diff changeset
    33
    void localTeamAdded(const QString & teamName, int aiLevel);
10444
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    34
    void localTeamRemoved(const QString & teamName);
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    35
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    36
    void playingTeamAdded(const QString & teamName, int aiLevel, bool isLocal);
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    37
    void playingTeamRemoved(const QString & teamName);
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10442
diff changeset
    38
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    39
public slots:
10416
1c301054694d - Remove --port command
unc0rr
parents: 10402
diff changeset
    40
1c301054694d - Remove --port command
unc0rr
parents: 10402
diff changeset
    41
private:
10420
unc0rr
parents: 10418
diff changeset
    42
    QQmlEngine * m_engine;
10416
1c301054694d - Remove --port command
unc0rr
parents: 10402
diff changeset
    43
10428
7c25297720f1 More refactoring: move PoC preview getting code into flib
unc0rr
parents: 10426
diff changeset
    44
    static void guiMessagesCallback(void * context, MessageType mt, const char * msg, uint32_t len);
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    45
    void fillModels();
10420
unc0rr
parents: 10418
diff changeset
    46
unc0rr
parents: 10418
diff changeset
    47
private slots:
10430
899a30018ede Getter and setter for seed
unc0rr
parents: 10428
diff changeset
    48
    void engineMessageHandler(MessageType mt, const QByteArray &msg);
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    49
};
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    50
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    51
#endif // HWENGINE_H
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    52