Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
card_picture_to_load.h
Go to the documentation of this file.
1#ifndef PICTURE_TO_LOAD_H
2#define PICTURE_TO_LOAD_H
3
5
6#include <QList>
7#include <QLoggingCategory>
8#include <QSharedPointer>
9#include <QString>
11
12inline Q_LOGGING_CATEGORY(CardPictureToLoadLog, "card_picture_loader.picture_to_load");
13
26{
27private:
32 QString currentUrl;
36
37public:
44 explicit CardPictureToLoad(const ExactCard &_card);
45
47 [[nodiscard]] const ExactCard &getCard() const
48 {
49 return card;
50 }
51
53 [[nodiscard]] QString getCurrentUrl() const
54 {
55 return currentUrl;
56 }
57
59 [[nodiscard]] CardSetPtr getCurrentSet() const
60 {
61 return currentSet;
62 }
63
65 [[nodiscard]] QString getSetName() const;
66
68 [[nodiscard]] QString peekNextUrl() const;
69
75 QString transformUrl(const QString &urlTemplate) const;
76
84 bool nextSet();
85
93 bool nextUrl();
94
100 void populateSetUrls();
101
108 void resetIndices();
109
119};
120
121#endif // PICTURE_TO_LOAD_H
QSharedPointer< CardSet > CardSetPtr
Definition card_info.h:30
QList< CardSetPtr > sortedSets
All sets for this card, sorted by priority.
Definition card_picture_to_load.h:29
QString transformUrl(const QString &urlTemplate) const
Transforms a URL template into a concrete URL for this card/set.
Definition card_picture_to_load.cpp:254
bool nextUrl()
Advance to the next URL in the current set's list.
Definition card_picture_to_load.cpp:135
const ExactCard & getCard() const
Definition card_picture_to_load.h:47
void populateSetUrls()
Populates the currentSetUrls list with URLs for the current set.
Definition card_picture_to_load.cpp:92
QString getCurrentUrl() const
Definition card_picture_to_load.h:53
ExactCard card
The ExactCard being downloaded.
Definition card_picture_to_load.h:28
QString currentUrl
Currently active URL to download.
Definition card_picture_to_load.h:32
CardSetPtr getCurrentSet() const
Definition card_picture_to_load.h:59
static QList< CardSetPtr > extractSetsSorted(const ExactCard &card)
Extract all sets from the card and sort them by priority.
Definition card_picture_to_load.cpp:36
bool nextSet()
Advance to the next set in the list.
Definition card_picture_to_load.cpp:123
QList< QString > currentSetUrls
URLs for the current set being attempted.
Definition card_picture_to_load.h:31
QString peekNextUrl() const
Definition card_picture_to_load.cpp:155
QList< QString > urlTemplates
URL templates from settings.
Definition card_picture_to_load.h:30
int currentSetIndex
Current position in sortedSets.
Definition card_picture_to_load.h:34
QString getSetName() const
Definition card_picture_to_load.cpp:146
int currentUrlIndex
Current position in currentSetUrls.
Definition card_picture_to_load.h:35
void resetIndices()
Resets iteration indices to the beginning.
Definition card_picture_to_load.cpp:164
CardPictureToLoad(const ExactCard &_card)
Constructs a CardPictureToLoad for a given ExactCard.
Definition card_picture_to_load.cpp:25
CardSetPtr currentSet
Currently active set.
Definition card_picture_to_load.h:33
Represents a specific card instance, defined by its CardInfo and a particular printing.
Definition exact_card.h:24
Definition remote_connection_controller.h:20
Q_LOGGING_CATEGORY(CrashReportLog, "crash_report")