mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -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;
|
||||
}
|
||||
|
||||
QString OracleImporter::getMainCardType(const QStringList &typeList)
|
||||
static QString getMainCardType(const QStringList &typeList)
|
||||
{
|
||||
if (typeList.isEmpty()) {
|
||||
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)) {
|
||||
return type;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,8 +121,6 @@ class OracleImporter : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
const QStringList mainCardTypes = {"Planeswalker", "Creature", "Land", "Sorcery",
|
||||
"Instant", "Artifact", "Enchantment"};
|
||||
static const QRegularExpression formatRegex;
|
||||
|
||||
/**
|
||||
|
|
@ -137,7 +135,6 @@ private:
|
|||
|
||||
QList<SetToDownload> allSets;
|
||||
|
||||
QString getMainCardType(const QStringList &typeList);
|
||||
CardInfoPtr addCard(QString name,
|
||||
QString text,
|
||||
bool isToken,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue