6#include <QGraphicsScene>
9#include <QLoggingCategory>
19#include <qtmetamacros.h>
24#include <libcockatrice/protocol/pb/serverinfo_card.pb.h>
34inline Q_LOGGING_CATEGORY(GameScenePlayerAdditionRemovalLog,
"game_scene.player_addition_removal");
239 bool withWritePermission);
Definition abstract_card_item.h:29
Definition arrow_registry.h:27
Definition card_item.h:33
Definition card_zone_logic.h:27
Definition card_zone.h:35
void onCardRightClicked(AbstractCardItem *card, QPoint screenPos)
Definition game_scene.cpp:147
qreal calculateNewSceneWidth(const QSize &newSize, qreal minWidth) const
Calculates new scene width considering window aspect ratio.
Definition game_scene.cpp:480
static int determineColumnCount(int playerCount)
Determines the number of columns to display players in.
Definition game_scene.cpp:388
void toggleZoneView(PlayerLogic *player, const QString &zoneName, int numberCards, bool isReversed=false)
Toggles a zone view for a player.
Definition game_scene.cpp:695
void removeZoneView(ZoneViewWidget *item)
Removes a zone view widget from the scene.
Definition game_scene.cpp:747
void removePlayer(PlayerLogic *player)
Removes a player from the scene.
Definition game_scene.cpp:243
QList< CardItem * > selectedCards() const
Gets all selected CardItems.
Definition game_scene.cpp:115
void requestArrowDeletion(int playerId, int arrowId)
Queues up arrow deletion but doesn't directly modify the scene.
Definition game_scene.cpp:568
QList< PlayerLogic * > collectActivePlayers(int &firstPlayerIndex) const
Collects all active (non-conceded) players.
Definition game_scene.cpp:346
QHash< QObject *, IAnimatedItem * > animatedItems
Items currently animating.
Definition game_scene.h:73
QSizeF computeSceneSizeAndPlayerLayout(const QList< PlayerLogic * > &playersPlaying, int columns)
Computes layout positions and scene size based on players and columns.
Definition game_scene.cpp:406
void resizeRubberBand(const QPointF &cursorPoint, int selectedCount)
Definition game_scene.cpp:868
QList< PlayerLogic * > rotatePlayers(const QList< PlayerLogic * > &players, int firstPlayerIndex) const
Rotates the list of players for layout.
Definition game_scene.cpp:373
void startRubberBand(const QPointF &selectionOrigin)
Definition game_scene.cpp:863
static CardZone * findTopmostZone(const QList< QGraphicsItem * > &items)
Finds the topmost card zone under the cursor.
Definition game_scene.cpp:646
void timerEvent(QTimerEvent *event) override
Handles animation timer updates.
Definition game_scene.cpp:808
PhasesToolbar * phasesToolbar
Toolbar showing game phases.
Definition game_scene.h:65
QList< qreal > calculateMinWidthByColumn() const
Computes the minimum width for each column based on player minimum widths.
Definition game_scene.cpp:461
void updateHoveredCard(CardItem *newCard)
Updates hovered card highlighting.
Definition game_scene.cpp:619
void clearViews()
Closes all zone views.
Definition game_scene.cpp:756
void deleteArrow(int playerId, int arrowId)
Definition game_scene.cpp:561
void onCardZoneChanged(CardItem *card, bool sameZone)
Definition game_scene.cpp:575
QTransform getViewTransform() const
Definition game_scene.cpp:785
static CardItem * findTopmostCardInZone(const QList< QGraphicsItem * > &items, CardZone *zone)
Finds the topmost card in a given zone, considering attachments and Z-order.
Definition game_scene.cpp:656
void beginCardHover(CardItem *card)
Activates hover state and escapes the card from its clip container so hover scaling is visible beyond...
Definition game_scene.cpp:630
void clearArrowsForPlayer(int playerId)
Definition game_scene.cpp:592
void arrowDeletionRequested(int creatorId, int arrowId)
void addRevealedZoneView(PlayerLogic *player, CardZoneLogic *zone, const QList< const ServerInfo_Card * > &cardList, bool withWritePermission)
Adds a revealed zone view (for shown cards).
Definition game_scene.cpp:731
void playSelectedFaceDown(AbstractCardItem *card)
Definition game_scene.cpp:179
void unregisterAnimationItem(IAnimatedItem *item)
Unregisters an item from animation updates.
Definition game_scene.cpp:844
static const int playerAreaSpacing
Space between player areas.
Definition game_scene.h:63
void registerAnimationItem(IAnimatedItem *item)
Registers an item for animation updates with the shared scene timer.
Definition game_scene.cpp:822
bool needsReArrange
Pending rearrange requested during a pass.
Definition game_scene.h:78
QSize viewSize
Current view size.
Definition game_scene.h:70
void stopRubberBand()
Definition game_scene.cpp:873
void clearArrowsForPlayerLocally(int playerId)
Definition game_scene.cpp:599
QHash< QObject *, QMetaObject::Connection > animationItemConnections
destroyed->removeAnimatedItem handles per animated item
Definition game_scene.h:75
void closeMostRecentZoneView()
Closes the most recently added zone view.
Definition game_scene.cpp:776
bool event(QEvent *event) override
Handles hover updates.
Definition game_scene.cpp:797
void emptyActiveViews()
Empties the contents of all non-reveal zone views. Used for replay rewinding.
Definition game_scene.cpp:763
void endCardHover(CardItem *card)
Deactivates hover state and restores the card to its clip container.
Definition game_scene.cpp:638
int playerRotation
Rotation offset for player layout.
Definition game_scene.h:76
QPointer< CardItem > hoveredCard
Currently hovered card.
Definition game_scene.h:71
void retranslateUi()
Updates UI text for all zone views.
Definition game_scene.cpp:108
void processViewSizeChange(const QSize &newSize)
Handles view resize and redistributes player positions.
Definition game_scene.cpp:324
QList< QList< PlayerGraphicsItem * > > playersByColumn
Players organized by column.
Definition game_scene.h:67
void addArrow(QSharedPointer< ArrowData > data)
Directly modifies the scene.
Definition game_scene.cpp:522
QMap< int, PlayerGraphicsItem * > getPlayers() const
Definition game_scene.h:123
void adjustPlayerRotation(int rotationAdjustment)
Adjusts the global rotation offset for player layout.
Definition game_scene.cpp:271
QBasicTimer * animationTimer
Timer for scene animations.
Definition game_scene.h:72
QTransform getViewportTransform() const
Definition game_scene.cpp:790
void addPlayer(PlayerLogic *player)
Adds a player to the scene and stores their graphics item.
Definition game_scene.cpp:207
PlayerGraphicsItem * viewForPlayer(int playerId)
Definition game_scene.h:128
QMap< int, PlayerGraphicsItem * > playerViews
ID lookup for player graphics items.
Definition game_scene.h:66
void resizeColumnsAndPlayers(const QList< qreal > &minWidthByColumn, qreal newWidth)
Resizes columns and distributes extra width to players.
Definition game_scene.cpp:500
void hideSelected(AbstractCardItem *card)
Definition game_scene.cpp:190
void playSelected(AbstractCardItem *card)
Definition game_scene.cpp:168
void removeAnimatedItem(QObject *item)
Removes a destroyed item from the animation set.
Definition game_scene.cpp:852
ArrowRegistry arrowRegistry
ID registry for arrow graphics items.
Definition game_scene.h:68
QList< ZoneViewWidget * > zoneViews
Active zone view widgets.
Definition game_scene.h:69
void sigResizeRubberBand(const QPointF &cursorPoint, int selectedCount)
bool rearranging
Guard against re-entrant rearrange.
Definition game_scene.h:77
void rearrange()
Recomputes the layout of players and the scene size.
Definition game_scene.cpp:288
void sigStartRubberBand(const QPointF &selectionOrigin)
GameScene(PhasesToolbar *_phasesToolbar, QObject *parent=nullptr)
Constructs the GameScene.
Definition game_scene.cpp:59
void updateHover(const QPointF &scenePos)
Updates which card is currently hovered based on scene coordinates.
Definition game_scene.cpp:610
void onCardSelectionChanged(AbstractCardItem *card, bool selected)
Definition game_scene.cpp:127
Definition animated_item.h:15
Definition player_graphics_item.h:39
Definition player_logic.h:56
Definition mana_curve_category_widget.h:11
Definition remote_connection_controller.h:20
Definition arrow_registry.h:10
Q_LOGGING_CATEGORY(CrashReportLog, "crash_report")
Definition arrow_data.h:10
Definition serverinfo_card.proto:5