mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-17 16:02:14 -07:00
Player holds the deck, emits deckChanged(), other elements player->getDeck() to respond to changes.
Took 37 minutes
This commit is contained in:
parent
57aa1abc69
commit
c344b40a71
8 changed files with 61 additions and 41 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue