Cockatrice/cockatrice/src/game_graphics/player/player_dialogs.h
BruebachL 345b0e8ba9
[Refactor] Move game logic into libcockatrice_game (#7437)
* [Refactor] Move game logic into libcockatrice_game

* [Refactor] Include card_state.h in player_actions.h

* [Game] Inject settings providers into libcockatrice_game, drop Widgets

* [Game] Follow base rename to createCardRequested after rebase

* [Game] Drop unused CardItem forward declaration

* [Game] Fix includes after moving game logic into libcockatrice_game

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-10-31 18:44:15 +01:00

79 lines
3 KiB
C++

#ifndef COCKATRICE_PLAYER_DIALOGS_H
#define COCKATRICE_PLAYER_DIALOGS_H
#include "player_graphics_item.h"
// IWYU pragma: keep
// MoveTopCardsUntilOptions is passed by value to a slot, so the moc-generated
// code needs the complete type.
#include "../dialogs/dlg_move_top_cards_until.h"
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
#include <qtmetamacros.h>
class CardItem;
class CardRelation;
class CardState;
class PlayerActions;
class QWidget;
struct MoveTopCardsUntilOptions;
class PlayerDialogs : public QObject
{
Q_OBJECT
public:
explicit PlayerDialogs(PlayerGraphicsItem *player, PlayerActions *playerActions);
signals:
void requestDialogSemaphore(bool active);
public slots:
void onViewTopCardsDialogRequested(int defaultNumberTopCards, int deckSize);
void onViewBottomCardsDialogRequested(int defaultNumberBottomCards, int deckSize);
void onShuffleTopDialogRequested(int defaultNumberTopCards, int maxCards);
void onShuffleBottomDialogRequested(int defaultNumberBottomCards, int maxCards);
void onMulliganDialogRequested(int startSize, int handSize, int deckSize);
void onDrawCardsDialogRequested(int defaultNumberTopCards, int deckSize);
void onMoveTopCardsToDialogRequested(int defaultNumberTopCards,
int maxCards,
const QString &targetZone,
const QString &zoneDisplayName,
bool faceDown);
void onMoveTopCardsUntilDialogRequested(MoveTopCardsUntilOptions options);
void onMoveBottomCardsToDialogRequested(int defaultNumberBottomCards,
int maxCards,
const QString &targetZone,
const QString &zoneDisplayName,
bool faceDown);
void onDrawBottomCardsDialogRequested(int defaultNumberBottomCards, int maxCards);
void onRollDieDialogRequested();
void onCreateRelatedFromRelationDialogRequested(const CardState *sourceCard, const CardRelation *cardRelation);
void onCreateTokenDialogRequested(const QStringList &predefinedTokens);
void onMoveCardXCardsFromTopDialogRequested(int defaultNumberTopCardsToPlaceBelow, int deckSize);
void onSetPTDialogRequested(const QString &oldPT);
void onSetAnnotationDialogRequested(const QString &oldAnnotation);
void onSetCardCounterDialogRequested(int counterId, const QString &oldValueForDlg);
void onStartingHandSizeChosen(int number);
private:
PlayerGraphicsItem *player;
PlayerActions *playerActions;
QWidget *dialogParent() const
{
if (auto *s = player->scene()) {
if (auto *v = s->views().value(0)) {
return v->window();
}
}
return nullptr;
}
};
#endif // COCKATRICE_PLAYER_DIALOGS_H