mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-18 15:56:34 -08:00
prioritize creature on maincardtype (#3611)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user