Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
cavokeclientmodel.h
1#ifndef CAVOKECLIENTMODEL_H
2#define CAVOKECLIENTMODEL_H
3
4#include <QObject>
5#include "cavokeqmlgamemodel.h"
6#include "entities/gameinfo.h"
7
8class CavokeClientModel : public QObject {
9 Q_OBJECT
10
11public:
12 explicit CavokeClientModel(QObject *parent = nullptr);
13 GameInfo getGameByIndex(int index); // FIXME: oh no, cringe
14public slots:
15 void loadQmlGame(const QString &gameId);
16 void updateGamesList(const QJsonArray &newGamesList);
17 void receivedGameIndexChange(int newIndex);
18 void receivedGameIndexChangeInList(int newIndex);
19 void gotIndexToDownload(int index);
20 void gotGameIdToDownload(const QString &gameId);
21signals:
22 void startQmlApplication(CavokeQmlGameModel *);
23 void gamesListUpdated(const std::vector<GameInfo> &newGamesList);
24 void updateSelectedGame(const GameInfo &gameInfo);
25 void updateSelectedGameInList(const GameInfo &gameInfo);
26 void downloadGame(const QString &gameId);
27
28private:
29 std::vector<GameInfo> gamesList;
30};
31
32#endif // CAVOKECLIENTMODEL_H