mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 02:53:25 -08:00
[Refactor] Build player counter commands in game/ instead of AbstractCounter
This commit is contained in:
parent
fa14179445
commit
0f5b1a032a
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
|
||||
|
|
|
|||
|
|
@ -239,6 +239,12 @@ public slots:
|
|||
void actFlowP(QList<CardItem *> selectedCards);
|
||||
void actFlowT(QList<CardItem *> selectedCards);
|
||||
|
||||
/** @brief Adjusts a player counter by a signed delta. */
|
||||
void actIncrementCounter(int counterId, int delta);
|
||||
|
||||
/** @brief Sets a player counter to an absolute value. */
|
||||
void actSetCounter(int counterId, int value);
|
||||
|
||||
void actReduceLifeByPower(QList<CardItem *> selectedCards);
|
||||
|
||||
void actRequestSetAnnotationDialog(QList<CardItem *> selectedCards);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue