Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
intent_open_shared_deck.h
Go to the documentation of this file.
1#ifndef COCKATRICE_INTENT_OPEN_SHARED_DECK_H
2#define COCKATRICE_INTENT_OPEN_SHARED_DECK_H
3
6#include "intent.h"
7
8#include <QList>
9#include <QMap>
10#include <QScopedPointer>
11#include <QString>
12#include <memory>
13#include <qtmetamacros.h>
14
15class TabSupervisor;
18class QTimer;
20class RemoteClient;
21class Response;
22
24{
25 Q_OBJECT
26
27public:
28 IntentOpenSharedDeck(TabSupervisor *_tabSupervisor,
29 RemoteClient *_remoteClient,
30 const CardDatabaseQuerier *_querier,
31 std::unique_ptr<ContextOpenDeck> _context);
32
33protected:
34 bool checkPrecondition() const override;
35 void onPreconditionSatisfied() override;
36 void onPreconditionNotSatisfied() override;
37
38private slots:
39 void listShareFinished(const Response &response, const CommandContainer &commandContainer);
40 void downloadShareFinished(const Response &response, const CommandContainer &commandContainer);
41 void onDownloadTimeout();
42
43private:
44 void startDownloads(const QList<int> &itemIds);
45 void downloadNextItem();
46 void onItemFailure(const QString &reason);
47 void finishAll();
48
52 QScopedPointer<ContextOpenDeck> context;
58 bool listPhase = true;
60 int totalItems = 0;
62};
63
64#endif // COCKATRICE_INTENT_OPEN_SHARED_DECK_H
Provides lookup and convenience functions for querying cards and their printings.
Definition card_database_querier.h:29
Non-modal preview of the decks contained in a shared-deck link.
Definition dlg_shared_decks_preview.h:29
void onItemFailure(const QString &reason)
Definition intent_open_shared_deck.cpp:176
void onDownloadTimeout()
Definition intent_open_shared_deck.cpp:201
const CardDatabaseQuerier * querier
Definition intent_open_shared_deck.h:51
DlgSharedDecksPreview * previewDialog
Definition intent_open_shared_deck.h:53
int currentItemId
Definition intent_open_shared_deck.h:59
bool checkPrecondition() const override
Definition intent_open_shared_deck.cpp:43
int totalItems
Definition intent_open_shared_deck.h:60
TabSupervisor * tabSupervisor
Definition intent_open_shared_deck.h:49
IntentOpenSharedDeck(TabSupervisor *_tabSupervisor, RemoteClient *_remoteClient, const CardDatabaseQuerier *_querier, std::unique_ptr< ContextOpenDeck > _context)
Definition intent_open_shared_deck.cpp:30
RemoteClient * remoteClient
Definition intent_open_shared_deck.h:50
QTimer * downloadTimer
Definition intent_open_shared_deck.h:54
void onPreconditionSatisfied() override
Definition intent_open_shared_deck.cpp:59
void listShareFinished(const Response &response, const CommandContainer &commandContainer)
Definition intent_open_shared_deck.cpp:80
QList< int > pendingItemIds
Definition intent_open_shared_deck.h:56
int completedItems
Definition intent_open_shared_deck.h:61
void finishAll()
Definition intent_open_shared_deck.cpp:212
bool listPhase
Definition intent_open_shared_deck.h:58
QScopedPointer< ContextOpenDeck > context
Definition intent_open_shared_deck.h:52
void downloadNextItem()
Definition intent_open_shared_deck.cpp:125
void downloadShareFinished(const Response &response, const CommandContainer &commandContainer)
Definition intent_open_shared_deck.cpp:144
void onPreconditionNotSatisfied() override
Definition intent_open_shared_deck.cpp:75
QMap< int, QString > itemNames
Definition intent_open_shared_deck.h:55
QList< LoadedDeck > loadedDecks
Definition intent_open_shared_deck.h:57
void startDownloads(const QList< int > &itemIds)
Definition intent_open_shared_deck.cpp:116
Intent(QObject *parent=nullptr)
Definition intent.cpp:3
Definition remote_connection_controller.h:20
Definition game.h:18
Definition remote_client.h:34
Definition tab_supervisor.h:92
Definition commands.proto:8
Definition response.proto:11