mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 11:03:25 -08:00
[Refactor] Build player counter commands in game/ instead of AbstractCounter (#7420)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
73d5a2a0ab
commit
674a607960
3 changed files with 28 additions and 14 deletions
|
|
@ -60,6 +60,7 @@
|
|||
#include <libcockatrice/protocol/pb/command_roll_die.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_set_card_attr.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_set_card_counter.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_set_counter.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_shuffle.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_undo_draw.pb.h>
|
||||
#include <libcockatrice/settings/card_override_settings.h>
|
||||
|
|
@ -1450,6 +1451,24 @@ void PlayerActions::actFlowT(QList<CardItem *> selectedCards)
|
|||
actIncPT(selectedCards, -1, 1);
|
||||
}
|
||||
|
||||
void PlayerActions::actIncrementCounter(int counterId, int delta)
|
||||
{
|
||||
Command_IncCounter cmd;
|
||||
cmd.set_counter_id(counterId);
|
||||
cmd.set_delta(delta);
|
||||
|
||||
sendGameCommand(cmd);
|
||||
}
|
||||
|
||||
void PlayerActions::actSetCounter(int counterId, int value)
|
||||
{
|
||||
Command_SetCounter cmd;
|
||||
cmd.set_counter_id(counterId);
|
||||
cmd.set_value(value);
|
||||
|
||||
sendGameCommand(cmd);
|
||||
}
|
||||
|
||||
void PlayerActions::actReduceLifeByPower(QList<CardItem *> selectedCards)
|
||||
{
|
||||
// find life counter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue