From 5a5ca0fe1cb0812a26a3a38edd519ecb09e53a58 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Thu, 28 May 2026 02:07:39 -0700 Subject: [PATCH] move stuff around and docs --- cockatrice/src/game/game_scene.cpp | 18 +++++++++--------- cockatrice/src/game/game_scene.h | 6 +++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/cockatrice/src/game/game_scene.cpp b/cockatrice/src/game/game_scene.cpp index 380bbd422..d9ffe3443 100644 --- a/cockatrice/src/game/game_scene.cpp +++ b/cockatrice/src/game/game_scene.cpp @@ -419,6 +419,15 @@ void GameScene::requestArrowDeletion(int arrowId) } } +void GameScene::requestClearArrowsForPlayer(int playerId) +{ + for (auto *arrow : arrowRegistry.values()) { + if (arrow->getPlayer()->getPlayerInfo()->getId() == playerId) { + emit requestArrowDeletion(arrow->getId()); + } + } +} + void GameScene::onCardZoneChanged(CardItem *card, bool sameZone) { QList toDelete; @@ -436,15 +445,6 @@ void GameScene::onCardZoneChanged(CardItem *card, bool sameZone) } } -void GameScene::requestClearArrowsForPlayer(int playerId) -{ - for (auto *arrow : arrowRegistry.values()) { - if (arrow->getPlayer()->getPlayerInfo()->getId() == playerId) { - emit requestArrowDeletion(arrow->getId()); - } - } -} - // ---------- Hover Handling ---------- void GameScene::updateHover(const QPointF &scenePos) diff --git a/cockatrice/src/game/game_scene.h b/cockatrice/src/game/game_scene.h index ad100527e..70dbfb3d9 100644 --- a/cockatrice/src/game/game_scene.h +++ b/cockatrice/src/game/game_scene.h @@ -201,12 +201,16 @@ public slots: QTransform getViewTransform() const; QTransform getViewportTransform() const; + /// Directly modifies the scene void addArrow(const ArrowData &data); void deleteArrow(int arrowId); + + /// Queues up arrow deletion but doesn't directly modify the scene void requestArrowDeletion(int arrowId); - void onCardZoneChanged(CardItem *card, bool sameZone); void requestClearArrowsForPlayer(int playerId); + void onCardZoneChanged(CardItem *card, bool sameZone); + protected: /** @brief Handles hover updates. */ bool event(QEvent *event) override;