Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
Loading...
Searching...
No Matches
commander_spellbook_api_accessor.h
Go to the documentation of this file.
1
#ifndef COCKATRICE_COMMANDER_SPELLBOOK_API_ACCESSOR_H
2
#define COCKATRICE_COMMANDER_SPELLBOOK_API_ACCESSOR_H
3
4
#include <QNetworkAccessManager>
5
#include <QObject>
6
#include <QString>
7
#include <QtGlobal>
8
#include <qtmetamacros.h>
9
10
class
DeckList
;
11
class
QNetworkReply;
12
struct
EstimateBracketResult
;
13
14
class
CommanderSpellbookApiAccessor
final :
public
QObject
15
{
16
Q_OBJECT
17
18
public
:
19
static
CommanderSpellbookApiAccessor
&
instance
();
20
21
using
RequestId
= quint64;
22
23
RequestId
estimateBracket
(
const
DeckList
&deck, QObject *requester);
24
25
signals:
26
void
estimateBracketFinished
(
RequestId
id
, QObject *requester,
const
EstimateBracketResult
&result);
27
28
void
estimateBracketError
(
RequestId
id
, QObject *requester,
const
QString &errorMessage);
29
30
private
:
31
explicit
CommanderSpellbookApiAccessor
(QObject *parent =
nullptr
);
32
Q_DISABLE_COPY_MOVE(
CommanderSpellbookApiAccessor
)
33
34
void
onEstimateReplyFinished
(QNetworkReply *reply);
35
36
QNetworkAccessManager
network
;
37
RequestId
nextRequestId
= 1;
38
};
39
40
#endif
// COCKATRICE_COMMANDER_SPELLBOOK_API_ACCESSOR_H
CommanderSpellbookApiAccessor::estimateBracketError
void estimateBracketError(RequestId id, QObject *requester, const QString &errorMessage)
CommanderSpellbookApiAccessor::RequestId
quint64 RequestId
Definition
commander_spellbook_api_accessor.h:21
CommanderSpellbookApiAccessor::nextRequestId
RequestId nextRequestId
Definition
commander_spellbook_api_accessor.h:37
CommanderSpellbookApiAccessor::network
QNetworkAccessManager network
Definition
commander_spellbook_api_accessor.h:36
CommanderSpellbookApiAccessor::estimateBracket
RequestId estimateBracket(const DeckList &deck, QObject *requester)
Definition
commander_spellbook_api_accessor.cpp:31
CommanderSpellbookApiAccessor::estimateBracketFinished
void estimateBracketFinished(RequestId id, QObject *requester, const EstimateBracketResult &result)
CommanderSpellbookApiAccessor::instance
static CommanderSpellbookApiAccessor & instance()
Definition
commander_spellbook_api_accessor.cpp:21
CommanderSpellbookApiAccessor::onEstimateReplyFinished
void onEstimateReplyFinished(QNetworkReply *reply)
Definition
commander_spellbook_api_accessor.cpp:55
CommanderSpellbookApiAccessor::CommanderSpellbookApiAccessor
CommanderSpellbookApiAccessor(QObject *parent=nullptr)
Definition
commander_spellbook_api_accessor.cpp:27
DeckList
Represents a complete deck, including metadata, zones, cards, and sideboard plans.
Definition
deck_list.h:67
EstimateBracketResult
Definition
commander_spellbook_estimate_bracket_result.h:12
cockatrice
src
interface
widgets
tabs
api
commander_spellbook
commander_spellbook_api_accessor.h
Generated by
1.18.0