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;