mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 04:23:55 -07:00
* Create new class * Update CardInfo and CardDatabase * Use new class instead of CardInfoPtr * fix cmake
44 lines
956 B
C++
44 lines
956 B
C++
#ifndef PICTURE_TO_LOAD_H
|
|
#define PICTURE_TO_LOAD_H
|
|
|
|
#include "../../../game/cards/exact_card.h"
|
|
|
|
#include <QLoggingCategory>
|
|
|
|
inline Q_LOGGING_CATEGORY(PictureToLoadLog, "picture_loader.picture_to_load");
|
|
|
|
class PictureToLoad
|
|
{
|
|
private:
|
|
ExactCard card;
|
|
QList<CardSetPtr> sortedSets;
|
|
QList<QString> urlTemplates;
|
|
QList<QString> currentSetUrls;
|
|
QString currentUrl;
|
|
CardSetPtr currentSet;
|
|
|
|
public:
|
|
explicit PictureToLoad(const ExactCard &_card);
|
|
|
|
const ExactCard &getCard() const
|
|
{
|
|
return card;
|
|
}
|
|
QString getCurrentUrl() const
|
|
{
|
|
return currentUrl;
|
|
}
|
|
CardSetPtr getCurrentSet() const
|
|
{
|
|
return currentSet;
|
|
}
|
|
QString getSetName() const;
|
|
QString transformUrl(const QString &urlTemplate) const;
|
|
bool nextSet();
|
|
bool nextUrl();
|
|
void populateSetUrls();
|
|
|
|
static QList<CardSetPtr> extractSetsSorted(const ExactCard &card);
|
|
};
|
|
|
|
#endif // PICTURE_TO_LOAD_H
|