mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-17 07:52:16 -07:00
inline mainCardTypes list and make the method static
This commit is contained in:
parent
ac6b3b5909
commit
b75c88d6c7
2 changed files with 5 additions and 5 deletions
|
|
@ -85,13 +85,16 @@ bool OracleImporter::readSetsFromByteArray(const QByteArray &data)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString OracleImporter::getMainCardType(const QStringList &typeList)
|
static QString getMainCardType(const QStringList &typeList)
|
||||||
{
|
{
|
||||||
if (typeList.isEmpty()) {
|
if (typeList.isEmpty()) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &type : mainCardTypes) {
|
static const QStringList typePriority = {"Planeswalker", "Creature", "Land", "Sorcery",
|
||||||
|
"Instant", "Artifact", "Enchantment"};
|
||||||
|
|
||||||
|
for (const auto &type : typePriority) {
|
||||||
if (typeList.contains(type)) {
|
if (typeList.contains(type)) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,6 @@ class OracleImporter : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
const QStringList mainCardTypes = {"Planeswalker", "Creature", "Land", "Sorcery",
|
|
||||||
"Instant", "Artifact", "Enchantment"};
|
|
||||||
static const QRegularExpression formatRegex;
|
static const QRegularExpression formatRegex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -137,7 +135,6 @@ private:
|
||||||
|
|
||||||
QList<SetToDownload> allSets;
|
QList<SetToDownload> allSets;
|
||||||
|
|
||||||
QString getMainCardType(const QStringList &typeList);
|
|
||||||
CardInfoPtr addCard(QString name,
|
CardInfoPtr addCard(QString name,
|
||||||
QString text,
|
QString text,
|
||||||
bool isToken,
|
bool isToken,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue