From 28f84e1b4fff72272c5a6f857632177e72afc0ae Mon Sep 17 00:00:00 2001 From: RickyRister Date: Sat, 21 Feb 2026 17:55:40 -0800 Subject: [PATCH] revert refactor --- cockatrice/src/game/zones/card_zone.cpp | 17 ----------------- cockatrice/src/game/zones/card_zone.h | 9 --------- cockatrice/src/game/zones/table_zone.cpp | 5 ++--- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/cockatrice/src/game/zones/card_zone.cpp b/cockatrice/src/game/zones/card_zone.cpp index 0923c6b60..0c189cd2b 100644 --- a/cockatrice/src/game/zones/card_zone.cpp +++ b/cockatrice/src/game/zones/card_zone.cpp @@ -1,6 +1,5 @@ #include "card_zone.h" -#include "../board/card_drag_item.h" #include "../board/card_item.h" #include "view_zone.h" @@ -29,22 +28,6 @@ void CardZone::retranslateUi() getLogic()->getCards()[i]->retranslateUi(); } -bool CardZone::shouldDropFaceDown(const CardDragItem *item, const CardZoneLogic *startZone) const -{ - // forceFaceDown takes precedence over everything - if (item->isForceFaceDown()) { - return true; - } - - // Maintain face-down state if same zone. - // Compare using zone names so card remains face-down when you hand it over to your opponent - if (startZone->getName() == getLogic()->getName()) { - return item->getItem()->getFaceDown(); - } - - return false; -} - void CardZone::mouseDoubleClickEvent(QGraphicsSceneMouseEvent * /*event*/) { if (doubleClickAction) diff --git a/cockatrice/src/game/zones/card_zone.h b/cockatrice/src/game/zones/card_zone.h index 164539a76..6fe8157e4 100644 --- a/cockatrice/src/game/zones/card_zone.h +++ b/cockatrice/src/game/zones/card_zone.h @@ -67,15 +67,6 @@ public: doubleClickAction = _doubleClickAction; } - /** - * Checks if the dropEvent caused by the given CardDragItem should result in the face_down field of the resulting - * MoveCard command to be true. - * @param item The CardDragItem that is being dropped into this zone - * @param startZone The zone that the item came from - * @return Whether to set face_down to true - */ - bool shouldDropFaceDown(const CardDragItem *item, const CardZoneLogic *startZone) const; - private: CardZoneLogic *logic; }; diff --git a/cockatrice/src/game/zones/table_zone.cpp b/cockatrice/src/game/zones/table_zone.cpp index 9aa6b2596..86724ddb8 100644 --- a/cockatrice/src/game/zones/table_zone.cpp +++ b/cockatrice/src/game/zones/table_zone.cpp @@ -134,9 +134,8 @@ void TableZone::handleDropEventByGrid(const QList &dragItems, for (const auto &item : dragItems) { CardToMove *ctm = cmd.mutable_cards_to_move()->add_card(); ctm->set_card_id(item->getId()); - bool faceDown = shouldDropFaceDown(item, startZone); - ctm->set_face_down(faceDown); - if (startZone->getName() != getLogic()->getName() && !faceDown) { + ctm->set_face_down(item->isForceFaceDown()); + if (startZone->getName() != getLogic()->getName() && !item->isForceFaceDown()) { const auto &card = item->getItem()->getCard(); if (card) { ctm->set_pt(card.getInfo().getPowTough().toStdString());