prioritize creature on maincardtype (#3611)
This commit is contained in:
parent
477faafb84
commit
fafdb65453
1 changed files with 12 additions and 4 deletions
|
@ -242,9 +242,17 @@ int OracleImporter::importCardsFromSet(CardSetPtr currentSet, const QList<QVaria
|
|||
if (!colorIdentity.isEmpty())
|
||||
properties.insert("coloridentity", colorIdentity);
|
||||
|
||||
maintype = card.value("types").toStringList().first();
|
||||
if (!maintype.isEmpty())
|
||||
properties.insert("maintype", maintype);
|
||||
{
|
||||
const auto &typeList = card.value("types").toStringList();
|
||||
if (typeList.contains("Creature")) {
|
||||
properties.insert("maintype", "Creature");
|
||||
} else {
|
||||
const auto &maintype = typeList.first();
|
||||
if (!maintype.isEmpty()) {
|
||||
properties.insert("maintype", maintype);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
power = getStringPropertyFromMap(card, "power");
|
||||
toughness = getStringPropertyFromMap(card, "toughness");
|
||||
|
@ -383,4 +391,4 @@ bool OracleImporter::saveToFile(const QString &fileName)
|
|||
{
|
||||
CockatriceXml4Parser parser;
|
||||
return parser.saveToFile(sets, cards, fileName);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue