1#ifndef CAVOKECLIENTCONTROLLER_H
2#define CAVOKECLIENTCONTROLLER_H
6#include "cache_manager.h"
7#include "cavokeclientmodel.h"
8#include "network_manager.h"
9#include "views/creategameview.h"
10#include "views/gameslistview.h"
11#include "views/joingameview.h"
12#include "views/roomview.h"
13#include "views/sessionview.h"
14#include "views/settingsview.h"
15#include "views/startview.h"
16#include "views/statisticsview.h"
17#include "views/testwindowview.h"
20 enum class UserDisplacement { NOWHERE, ROOM, SESSION, GAME };
21 enum class QMLDownloadStatus { NOT_STARTED, DOWNLOADING, DOWNLOADED };
22 enum class HostGuestStatus { NOT_IN, HOST, GUEST };
28 void showTestWindowView();
30 void showJoinGameView();
31 void showGamesListView();
32 void showCreateGameView();
33 void showStatisticsView();
34 void showSettingsView();
36 void showSessionView();
37 void updateSettings(
const QString &displayName,
const QString &host);
41 void setGameName(
const QString &gameName);
42 void initSettingsValues(
const QString &nickname,
const QString &host);
44 void createdAvailableRolesList(
const std::vector<Role> &availableRoles);
48 void exitApplication();
49 void startQmlByGameId(
const QString &gameId);
50 void startLoadedQml();
52 void unpackDownloadedQml(QFile *file,
const QString &gameId);
53 void createGameStart(
const QString &roomName);
54 void joinGameStart(
const QString &inviteCode);
55 void createSessionStart(
const QString &gameId);
56 void joinSessionStart(
const QString &sessionId);
57 void gotCurrentGameInfo(
const GameInfo &gameInfo);
58 void gotRoomInfo(
const RoomInfo &roomInfo);
59 void gotSessionInfo(
const SessionInfo &sessionInfo);
60 void collectListOfAvailableRoles();
63 void becomeRoomHost();
64 void becomeRoomGuest();
65 void leftSession(
bool real_leave =
true);
69 void defaultSettingsInitialization();
70 const static inline QString PLAYER_NICKNAME{
"player/nickname"};
71 const static inline QString NETWORK_HOST{
"network/host"};
72 const static inline QString DEFAULT_NICKNAME{
"Guest"};
88 UserDisplacement displacement = UserDisplacement::NOWHERE;
89 QMLDownloadStatus qmlDownloadStatus = QMLDownloadStatus::NOT_STARTED;
90 HostGuestStatus hostGuestStatus = HostGuestStatus::NOT_IN;
91 HostGuestStatus roomHostGuestStatus = HostGuestStatus::NOT_IN;