/** * Interpret incoming messages (QJsonObject). * @param object */ void Battleships::interpretJsonObject(const QJsonObject &object) { if (object.value("type") == "SHOT") { takeShot(object); } if (object.value("type") == "SHOT_REPLAY") { shotReplay(object); } if (object.value("type") == "GAME_OFFER") { takeGameOffer(object); } if (object.value("type") == "GAME_OFFER_REPLAY") { gameOfferReplay(object); } if (object.value("type") == "FINISHED") { finishedMessage(object); } }
void MainWindow::playerTakeShot() { Q_EMIT takeShot(); }