Render and filter Continuum Universes Essence symbols instead of MTG mana

This commit is contained in:
Christian Daniel Jensen 2026-11-02 05:50:04 -07:00
parent 93fd16dc3a
commit 2bce66671f

View file

@ -1,6 +1,7 @@
#include "deck_color_identity.h" #include "deck_color_identity.h"
#include "libcockatrice/card/card_info.h" #include "libcockatrice/card/card_info.h"
#include <libcockatrice/card/essence_types.h>
#include <QChar> #include <QChar>
#include <QList> #include <QList>
@ -17,7 +18,7 @@ QString getDeckColorIdentity(const DeckList &deck, const CardDatabaseQuerier *db
return {}; return {};
} }
QSet<QChar> colorSet; // A set to collect unique color symbols (e.g., W, U, B, R, G) QSet<QChar> colorSet; // Unique Essence symbols (including N for colorless).
for (const QString &cardName : cardList) { for (const QString &cardName : cardList) {
CardInfoPtr currentCard = db->getCardInfo(cardName); CardInfoPtr currentCard = db->getCardInfo(cardName);
@ -29,10 +30,9 @@ QString getDeckColorIdentity(const DeckList &deck, const CardDatabaseQuerier *db
} }
} }
// Ensure the color identity is in WUBRG order // Canonical Essence order is shared by the database and all widgets.
QString colorIdentity; QString colorIdentity;
const QString wubrgOrder = "WUBRG"; for (const QChar &color : Essence::symbols()) {
for (const QChar &color : wubrgOrder) {
if (colorSet.contains(color)) { if (colorSet.contains(color)) {
colorIdentity.append(color); colorIdentity.append(color);
} }