[Card] Add facedown property to CardRelation (#6997)
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 15 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run

* [Card] Add facedown property to CardRelation

* trailing newline

* fix comments

* update schema
This commit is contained in:
RickyRister 2026-06-28 02:03:07 -07:00 committed by GitHub
parent 055ba9a16f
commit fcac7493ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 45 additions and 13 deletions

View file

@ -7,8 +7,10 @@ CardRelation::CardRelation(const QString &_name,
bool _isCreateAllExclusion,
bool _isVariableCount,
int _defaultCount,
bool _isPersistent)
bool _isPersistent,
bool _isFaceDown)
: name(_name), attachType(_attachType), isCreateAllExclusion(_isCreateAllExclusion),
isVariableCount(_isVariableCount), defaultCount(_defaultCount), isPersistent(_isPersistent)
isVariableCount(_isVariableCount), defaultCount(_defaultCount), isPersistent(_isPersistent),
isFaceDown(_isFaceDown)
{
}
}

View file

@ -31,6 +31,7 @@ private:
bool isVariableCount; ///< True if the number of creations is variable.
int defaultCount; ///< Default number of cards created or involved.
bool isPersistent; ///< True if this relation persists (i.e. is not destroyed) on zone change.
bool isFaceDown; ///< True if this relation creates the tokens facedown
public:
/**
@ -42,13 +43,15 @@ public:
* @param _isVariableCount Whether the count is variable.
* @param _defaultCount Default number for creations or transformations.
* @param _isPersistent Whether the relation persists across zone changes.
* @param _isFaceDown Whether the relation creates the token face down
*/
explicit CardRelation(const QString &_name = QString(),
CardRelationType _attachType = CardRelationType::DoesNotAttach,
bool _isCreateAllExclusion = false,
bool _isVariableCount = false,
int _defaultCount = 1,
bool _isPersistent = false);
bool _isPersistent = false,
bool _isFaceDown = false);
/**
* @brief Returns the name of the related card.
@ -151,6 +154,16 @@ public:
{
return isPersistent;
}
/**
* @brief Returns whether the relation creates the token facedown.
*
* @return True if facedown, false otherwise.
*/
[[nodiscard]] bool getIsFaceDown() const
{
return isFaceDown;
}
};
#endif // COCKATRICE_CARD_RELATION_H