refactor everything else

This commit is contained in:
RickyRister 2025-11-15 01:07:24 -08:00
parent 5734f51f3f
commit c58bdd08e0
10 changed files with 43 additions and 33 deletions

View file

@ -282,9 +282,13 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
}
properties.insert("colors", colors);
CardInfoPtr newCard =
CardInfo::newInstance(name, text, isToken, properties, relatedCards, reverseRelatedCards, _sets, cipt,
landscapeOrientation, tableRow, upsideDown);
CardInfo::UiAttributes attributes = {.cipt = cipt,
.landscapeOrientation = landscapeOrientation,
.tableRow = tableRow,
.upsideDownArt = upsideDown};
CardInfoPtr newCard = CardInfo::newInstance(name, text, isToken, properties, relatedCards,
reverseRelatedCards, _sets, attributes);
emit addCard(newCard);
}
}
@ -417,14 +421,15 @@ static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfoPtr &in
}
// positioning
xml.writeTextElement("tablerow", QString::number(info->getTableRow()));
if (info->getCipt()) {
const CardInfo::UiAttributes &attributes = info->getUiAttributes();
xml.writeTextElement("tablerow", QString::number(attributes.tableRow));
if (attributes.cipt) {
xml.writeTextElement("cipt", "1");
}
if (info->getLandscapeOrientation()) {
if (attributes.landscapeOrientation) {
xml.writeTextElement("landscapeOrientation", "1");
}
if (info->getUpsideDownArt()) {
if (attributes.upsideDownArt) {
xml.writeTextElement("upsidedown", "1");
}