Player holds the deck, emits deckChanged(), other elements player->getDeck() to respond to changes.

Took 37 minutes
This commit is contained in:
Lukas Brübach 2025-09-09 12:28:09 +02:00
parent 57aa1abc69
commit c344b40a71
8 changed files with 61 additions and 41 deletions

View file

@ -60,6 +60,7 @@ class Player : public QObject
signals:
void openDeckEditor(const DeckLoader *deck);
void deckChanged();
void newCardAdded(AbstractCardItem *card);
void rearrangeCounters();
void activeChanged(bool _active);
@ -121,6 +122,13 @@ public:
return playerMenu;
}
void setDeck(const DeckLoader &_deck);
[[nodiscard]] DeckLoader *getDeck() const
{
return deck;
}
template <typename T> T *addZone(T *zone)
{
zones.insert(zone->getName(), zone);
@ -211,6 +219,8 @@ private:
bool active;
DeckLoader *deck;
QMap<QString, CardZoneLogic *> zones;
QMap<int, AbstractCounter *> counters;
QMap<int, ArrowItem *> arrows;