mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
[Game] Refactor CardDragItem faceDown logic (#6552)
* Rename properties and only pass forceFaceDown * [Game] Refactor CardDragItem faceDown logic * revert refactor * leave face_down unset unless forced
This commit is contained in:
parent
2828854d32
commit
2fba5dcd20
6 changed files with 18 additions and 16 deletions
|
|
@ -134,8 +134,10 @@ void TableZone::handleDropEventByGrid(const QList<CardDragItem *> &dragItems,
|
|||
for (const auto &item : dragItems) {
|
||||
CardToMove *ctm = cmd.mutable_cards_to_move()->add_card();
|
||||
ctm->set_card_id(item->getId());
|
||||
ctm->set_face_down(item->getFaceDown());
|
||||
if (startZone->getName() != getLogic()->getName() && !item->getFaceDown()) {
|
||||
if (item->isForceFaceDown()) {
|
||||
ctm->set_face_down(true);
|
||||
}
|
||||
if (startZone->getName() != getLogic()->getName() && !item->isForceFaceDown()) {
|
||||
const auto &card = item->getItem()->getCard();
|
||||
if (card) {
|
||||
ctm->set_pt(card.getInfo().getPowTough().toStdString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue