Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
sessionview.h
1#ifndef CAVOKE_CLIENT_SESSIONVIEW_H
2#define CAVOKE_CLIENT_SESSIONVIEW_H
3
4#include <QMainWindow>
5#include "entities/role.h"
6#include "entities/sessioninfo.h"
7#include "entities/validationresult.h"
8
9namespace Ui {
10class SessionView;
11}
12
13class SessionView : public QMainWindow {
14 Q_OBJECT
15public:
16 enum class CreatingGameStatus { UNKNOWN, DOWNLOAD, REQUESTED, DONE };
17 explicit SessionView(QWidget *parent = nullptr);
19
20public slots:
21 void updateStatus(CreatingGameStatus newStatus);
22 void updateSessionInfo(const SessionInfo &sessionInfo);
23 void clear();
24 void updateValidationResult(const ValidationResult &validationResult);
25 void updateGameName(const QString &gameName);
26 void gotRolesListUpdate(const std::vector<Role> &newRolesList);
27
28signals:
29 void createdGame();
30 void joinedCreatedGame();
31 void shownRoomView();
32 void leftSession();
33 void newRoleChosen(int roleId);
34
35private slots:
36 void on_startGameButton_clicked();
37 void on_backButton_clicked();
38 void repeaterCurrentIndexChanged(int index);
39
40private:
41 Ui::SessionView *ui;
42 void show_as_host();
43 void show_as_guest();
44 const std::map<CreatingGameStatus, QString> STATUS = {
45 {CreatingGameStatus::UNKNOWN, "Unknown"},
46 {CreatingGameStatus::DOWNLOAD, "Downloading"},
47 {CreatingGameStatus::REQUESTED, "Sending request"},
48 {CreatingGameStatus::DONE, "Ready"},
49 };
50 int ourRole = -1;
51};
52
53#endif // CAVOKE_CLIENT_SESSIONVIEW_H