Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
cavokeqmlgamemodel.cpp
1#include "cavokeqmlgamemodel.h"
2#include <QDebug>
3
4CavokeQmlGameModel::CavokeQmlGameModel(QUrl qmlPath, QObject *parent)
5 : QObject{parent}, qmlPath{qmlPath} { // TODO: std::move
6}
7
8void CavokeQmlGameModel::getMoveFromQml(const QString &jsonMove) {
9 qDebug() << "CQGM: Received move! " << jsonMove;
10 // Maybe we should draw move on board even without network result?
11 emit sendMoveToNetwork(jsonMove);
12}
13
14void CavokeQmlGameModel::getUpdateFromNetwork(const QString &jsonUpdate) {
15 qDebug() << "CQGM: Received update! " << jsonUpdate;
16 emit receiveUpdate(jsonUpdate);
17}
18
19void CavokeQmlGameModel::getClosingFromQml(QQuickCloseEvent *close) {
20 qDebug() << "CQGM: Closing!! ";
21 emit closingQml();
22}