mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-27 17:13:54 -07:00
Analyze deck on tappedout Fix small bug in deckstats interface
This commit is contained in:
parent
680277ad6a
commit
7f28a7e844
10 changed files with 310 additions and 21 deletions
34
cockatrice/src/tappedout_interface.h
Normal file
34
cockatrice/src/tappedout_interface.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef TAPPEDOUT_INTERFACE_H
|
||||
#define TAPPEDOUT_INTERFACE_H
|
||||
|
||||
#include "carddatabase.h"
|
||||
#include "decklist.h"
|
||||
#include <QObject>
|
||||
|
||||
class QByteArray;
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeckList;
|
||||
|
||||
/**
|
||||
* TappedOutInterface exists in order to support the "Analyze on TappedOut" feature.
|
||||
* An http POST request is sent and the result is retrieved from the reply. Parsing
|
||||
* logic is implemented in TappedOutInterface::queryFinished().
|
||||
*/
|
||||
|
||||
class TappedOutInterface : public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QNetworkAccessManager *manager;
|
||||
|
||||
CardDatabase &cardDatabase;
|
||||
void copyDeckSplitMainAndSide(const DeckList &source, DeckList& mainboard, DeckList& sideboard);
|
||||
private slots:
|
||||
void queryFinished(QNetworkReply *reply);
|
||||
void getAnalyzeRequestData(DeckList *deck, QByteArray *data);
|
||||
public:
|
||||
TappedOutInterface(CardDatabase &_cardDatabase, QObject *parent = 0);
|
||||
void analyzeDeck(DeckList *deck);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue