mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -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
|
|
@ -246,7 +246,7 @@ void PlayerEventHandler::eventCreateCounter(const Event_CreateCounter &event)
|
|||
|
||||
void PlayerEventHandler::eventSetCounter(const Event_SetCounter &event)
|
||||
{
|
||||
AbstractCounter *ctr = player->getCounters().value(event.counter_id(), 0);
|
||||
CounterState *ctr = player->getCounters().value(event.counter_id(), nullptr);
|
||||
if (!ctr) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue