mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
Support MTGJSONv5 format in Oracle downloader (#4162)
* Fix #4043, Support MTGJSONv5 format in Oracle downloader * Auto redirect V4 downloads to V5, as we won't support V4 after this change * clangify >_> * Remove null values and account for IDs missing * fix split cards and double faced cards somewhat * do not consider double faced cards duplicates * fix promo double sided cards * typo * fix alternative versions of cards with (letter) * zach says this is more readable * pre qt 5.10 compatibility Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
parent
f3cf1f0dde
commit
9f9581c2be
5 changed files with 118 additions and 76 deletions
|
|
@ -60,10 +60,10 @@ public:
|
|||
class SplitCardPart
|
||||
{
|
||||
public:
|
||||
SplitCardPart(int _index, const QString &_text, const QVariantHash &_properties, CardInfoPerSet setInfo);
|
||||
inline const int &getIndex() const
|
||||
SplitCardPart(const QString &_name, const QString &_text, const QVariantHash &_properties, CardInfoPerSet setInfo);
|
||||
inline const QString &getName() const
|
||||
{
|
||||
return index;
|
||||
return name;
|
||||
}
|
||||
inline const QString &getText() const
|
||||
{
|
||||
|
|
@ -79,7 +79,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
int index;
|
||||
QString name;
|
||||
QString text;
|
||||
QVariantHash properties;
|
||||
CardInfoPerSet setInfo;
|
||||
|
|
@ -111,7 +111,7 @@ public:
|
|||
bool readSetsFromByteArray(const QByteArray &data);
|
||||
int startImport();
|
||||
bool saveToFile(const QString &fileName, const QString &sourceUrl, const QString &sourceVersion);
|
||||
int importCardsFromSet(CardSetPtr currentSet, const QList<QVariant> &cards, bool skipSpecialNums = true);
|
||||
int importCardsFromSet(const CardSetPtr ¤tSet, const QList<QVariant> &cards, bool skipSpecialNums = true);
|
||||
QList<SetToDownload> &getSets()
|
||||
{
|
||||
return allSets;
|
||||
|
|
@ -123,7 +123,7 @@ public:
|
|||
void clear();
|
||||
|
||||
protected:
|
||||
inline QString getStringPropertyFromMap(QVariantMap card, QString propertyName);
|
||||
inline QString getStringPropertyFromMap(const QVariantMap &card, const QString &propertyName);
|
||||
void sortAndReduceColors(QString &colors);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue