Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform 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
6inline Q_LOGGING_CATEGORY(CardPictureToLoadLog, "card_picture_loader.picture_to_load");
7
20{
21private:
23 QList<CardSetPtr> sortedSets;
24 QList<QString> urlTemplates;
25 QList<QString> currentSetUrls;
26 QString currentUrl;
28
29public:
36 explicit CardPictureToLoad(const ExactCard &_card);
37
39 [[nodiscard]] const ExactCard &getCard() const
40 {
41 return card;
42 }
43
45 [[nodiscard]] QString getCurrentUrl() const
46 {
47 return currentUrl;
48 }
49
51 [[nodiscard]] CardSetPtr getCurrentSet() const
52 {
53 return currentSet;
54 }
55
57 [[nodiscard]] QString getSetName() const;
58
64 QString transformUrl(const QString &urlTemplate) const;
65
73 bool nextSet();
74
82 bool nextUrl();
83
89 void populateSetUrls();
90
99 static QList<CardSetPtr> extractSetsSorted(const ExactCard &card);
100};
101
102#endif // PICTURE_TO_LOAD_H
QSharedPointer< CardSet > CardSetPtr
Definition card_info.h:24
Q_LOGGING_CATEGORY(CardPictureToLoadLog, "card_picture_loader.picture_to_load")
QList< CardSetPtr > sortedSets
All sets for this card, sorted by priority.
Definition card_picture_to_load.h:23
QString transformUrl(const QString &urlTemplate) const
Transforms a URL template into a concrete URL for this card/set.
Definition card_picture_to_load.cpp:213
bool nextUrl()
Advance to the next URL in the current set's list.
Definition card_picture_to_load.cpp:117
const ExactCard & getCard() const
Definition card_picture_to_load.h:39
void populateSetUrls()
Populates the currentSetUrls list with URLs for the current set.
Definition card_picture_to_load.cpp:78
QString getCurrentUrl() const
Definition card_picture_to_load.h:45
ExactCard card
The ExactCard being downloaded.
Definition card_picture_to_load.h:22
QString currentUrl
Currently active URL to download.
Definition card_picture_to_load.h:26
CardSetPtr getCurrentSet() const
Definition card_picture_to_load.h:51
static QList< CardSetPtr > extractSetsSorted(const ExactCard &card)
Extract all sets from the card and sort them by priority.
Definition card_picture_to_load.cpp:23
bool nextSet()
Advance to the next set in the list.
Definition card_picture_to_load.cpp:106
QList< QString > currentSetUrls
URLs for the current set being attempted.
Definition card_picture_to_load.h:25
QList< QString > urlTemplates
URL templates from settings.
Definition card_picture_to_load.h:24
QString getSetName() const
Definition card_picture_to_load.cpp:127
CardPictureToLoad(const ExactCard &_card)
Constructs a CardPictureToLoad for a given ExactCard.
Definition card_picture_to_load.cpp:13
CardSetPtr currentSet
Currently active set.
Definition card_picture_to_load.h:27
Represents a specific card instance, defined by its CardInfo and a particular printing.
Definition exact_card.h:19