![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <server_card.h>
Public Member Functions | |
| Server_Card (const CardRef &cardRef, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone=nullptr) | |
| ~Server_Card () override | |
| Server_CardZone * | getZone () const |
| void | setZone (Server_CardZone *_zone) |
| int | getId () const |
| CardRef | getCardRef () const |
| QString | getProviderId () const |
| int | getX () const |
| int | getY () const |
| QString | getName () const |
| const QMap< int, int > & | getCounters () const |
| int | getCounter (int counter_id) const |
| bool | getTapped () const |
| bool | getAttacking () const |
| bool | getFaceDown () const |
| QString | getColor () const |
| QString | getPT () const |
| QString | getAnnotation () const |
| bool | getDoesntUntap () const |
| bool | getDestroyOnZoneChange () const |
| Server_Card * | getParentCard () const |
| const QList< Server_Card * > & | getAttachedCards () const |
| void | setId (int _id) |
| void | setCoords (int x, int y) |
| void | setCardRef (const CardRef &_cardRef) |
| bool | setCounter (int _id, int value, Event_SetCardCounter *event=nullptr) |
| Sets a card counter to an exact value with clamping. | |
| bool | incrementCounter (int counterId, int delta, Event_SetCardCounter *event=nullptr) |
| Increments a card counter with overflow-safe arithmetic. | |
| void | setTapped (bool _tapped) |
| void | setAttacking (bool _attacking) |
| void | setFaceDown (bool _facedown) |
| void | setColor (const QString &_color) |
| void | setPT (const QString &_pt) |
| void | setAnnotation (const QString &_annotation) |
| void | setDestroyOnZoneChange (bool _destroy) |
| void | setDoesntUntap (bool _doesntUntap) |
| void | setParentCard (Server_Card *_parentCard) |
| void | addAttachedCard (Server_Card *card) |
| void | removeAttachedCard (Server_Card *card) |
| void | setStashedCard (Server_Card *card) |
| Server_Card * | takeStashedCard () |
| void | resetState (bool keepAnnotations=false) |
| QString | setAttribute (CardAttribute attribute, const QString &avalue, bool allCards) |
| QString | setAttribute (CardAttribute attribute, const QString &avalue, Event_SetCardAttr *event=nullptr) |
| void | getInfo (ServerInfo_Card *info) |
Private Attributes | |
| Server_CardZone * | zone |
| int | id |
| int | coord_x |
| int | coord_y |
| CardRef | cardRef |
| QMap< int, int > | counters |
| bool | tapped |
| bool | attacking |
| bool | facedown |
| QString | color |
| QString | ptString |
| QString | annotation |
| bool | destroyOnZoneChange |
| bool | doesntUntap |
| Server_Card * | parentCard |
| QList< Server_Card * > | attachedCards |
| Server_Card * | stashedCard |
| Server_Card::Server_Card | ( | const CardRef & | cardRef, |
| int | _id, | ||
| int | _coord_x, | ||
| int | _coord_y, | ||
| Server_CardZone * | _zone = nullptr ) |
|
override |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Server_Card::getInfo | ( | ServerInfo_Card * | info | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
nodiscard |
Increments a card counter with overflow-safe arithmetic.
| counterId | The counter ID to modify. |
| delta | The amount to add (may be negative for decrement). |
| event | Optional event to populate with counter state. |
|
inline |
| void Server_Card::resetState | ( | bool | keepAnnotations = false | ) |
|
inline |
|
inline |
| QString Server_Card::setAttribute | ( | CardAttribute | attribute, |
| const QString & | avalue, | ||
| bool | allCards ) |
| QString Server_Card::setAttribute | ( | CardAttribute | attribute, |
| const QString & | avalue, | ||
| Event_SetCardAttr * | event = nullptr ) |
|
inline |
|
inline |
|
inline |
|
nodiscard |
Sets a card counter to an exact value with clamping.
| _id | The counter ID. |
| value | The desired value (clamped to [0, MAX_COUNTER_VALUE]; 0 removes the counter). |
| event | Optional event to populate with counter state. |
|
inline |
|
inline |
|
inline |
|
inline |
| void Server_Card::setParentCard | ( | Server_Card * | _parentCard | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |