mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-17 04:27:45 -07:00
[Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem (#6944)
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem Took 4 minutes Took 48 seconds * Drop early return. Took 1 hour 13 minutes Took 2 minutes Took 1 minute * Delete player view. Took 37 seconds * Restore card counter color in menu. Took 5 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
1416ef0ea5
commit
90a49936d7
28 changed files with 538 additions and 368 deletions
|
|
@ -3,30 +3,40 @@
|
|||
#include "../player_actions.h"
|
||||
#include "../player_logic.h"
|
||||
|
||||
PtMenu::PtMenu(PlayerLogic *player) : QMenu(tr("Power / toughness"))
|
||||
PtMenu::PtMenu(PlayerGraphicsItem *player) : QMenu(tr("Power / toughness"))
|
||||
{
|
||||
PlayerActions *playerActions = player->getPlayerActions();
|
||||
PlayerActions *playerActions = player->getLogic()->getPlayerActions();
|
||||
|
||||
aIncP = new QAction(this);
|
||||
connect(aIncP, &QAction::triggered, playerActions, &PlayerActions::actIncP);
|
||||
connect(aIncP, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actIncP(player->getGameScene()->selectedCards()); });
|
||||
aDecP = new QAction(this);
|
||||
connect(aDecP, &QAction::triggered, playerActions, &PlayerActions::actDecP);
|
||||
connect(aDecP, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actDecP(player->getGameScene()->selectedCards()); });
|
||||
aIncT = new QAction(this);
|
||||
connect(aIncT, &QAction::triggered, playerActions, &PlayerActions::actIncT);
|
||||
connect(aIncT, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actIncT(player->getGameScene()->selectedCards()); });
|
||||
aDecT = new QAction(this);
|
||||
connect(aDecT, &QAction::triggered, playerActions, &PlayerActions::actDecT);
|
||||
connect(aDecT, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actDecT(player->getGameScene()->selectedCards()); });
|
||||
aIncPT = new QAction(this);
|
||||
connect(aIncPT, &QAction::triggered, playerActions, [playerActions] { playerActions->actIncPT(); });
|
||||
connect(aIncPT, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actIncPT(player->getGameScene()->selectedCards()); });
|
||||
aDecPT = new QAction(this);
|
||||
connect(aDecPT, &QAction::triggered, playerActions, &PlayerActions::actDecPT);
|
||||
connect(aDecPT, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actDecPT(player->getGameScene()->selectedCards()); });
|
||||
aFlowP = new QAction(this);
|
||||
connect(aFlowP, &QAction::triggered, playerActions, &PlayerActions::actFlowP);
|
||||
connect(aFlowP, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actFlowP(player->getGameScene()->selectedCards()); });
|
||||
aFlowT = new QAction(this);
|
||||
connect(aFlowT, &QAction::triggered, playerActions, &PlayerActions::actFlowT);
|
||||
connect(aFlowT, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actFlowT(player->getGameScene()->selectedCards()); });
|
||||
aSetPT = new QAction(this);
|
||||
connect(aSetPT, &QAction::triggered, playerActions, &PlayerActions::actSetPT);
|
||||
connect(aSetPT, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actSetPT(player->getGameScene()->selectedCards()); });
|
||||
aResetPT = new QAction(this);
|
||||
connect(aResetPT, &QAction::triggered, playerActions, &PlayerActions::actResetPT);
|
||||
connect(aResetPT, &QAction::triggered, playerActions,
|
||||
[player, playerActions] { playerActions->actResetPT(player->getGameScene()->selectedCards()); });
|
||||
|
||||
addAction(aIncP);
|
||||
addAction(aDecP);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue