mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 09:03:57 -07:00
[Game][Counters] Split counters into AbstractCounter (graphics) and CounterState (logic) (#6917)
* [Counters] Split counters into graphics and logic states Took 22 minutes * Don't have widget hold pointer to state -> Copy what we need and subscribe to changes. Took 12 minutes Took 5 seconds * Sync value too. Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
0549892092
commit
bddf9bd818
17 changed files with 273 additions and 199 deletions
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#ifndef COCKATRICE_PLAYER_GRAPHICS_ITEM_H
|
||||
#define COCKATRICE_PLAYER_GRAPHICS_ITEM_H
|
||||
#include "../board/abstract_counter.h"
|
||||
#include "../game_scene.h"
|
||||
#include "player_logic.h"
|
||||
|
||||
|
|
@ -102,6 +103,9 @@ public:
|
|||
|
||||
public slots:
|
||||
void onPlayerActiveChanged(bool _active);
|
||||
void onCounterAdded(CounterState *state);
|
||||
void onCounterRemoved(int counterId);
|
||||
void rearrangeCounters();
|
||||
void retranslateUi();
|
||||
|
||||
signals:
|
||||
|
|
@ -112,6 +116,7 @@ private:
|
|||
PlayerLogic *player;
|
||||
PlayerArea *playerArea;
|
||||
PlayerTarget *playerTarget;
|
||||
QMap<int, AbstractCounter *> counterWidgets;
|
||||
PileZone *deckZoneGraphicsItem;
|
||||
PileZone *sideboardGraphicsItem;
|
||||
PileZone *graveyardZoneGraphicsItem;
|
||||
|
|
@ -126,7 +131,6 @@ private:
|
|||
private slots:
|
||||
void updateBoundingRect();
|
||||
void rearrangeZones();
|
||||
void rearrangeCounters();
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_PLAYER_GRAPHICS_ITEM_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue