Introduce UUID attribute to abstract_card_item, card_item, deck_view_card, server_card and serverinfo_card.

This commit is contained in:
Lukas Brübach 2024-11-07 08:41:52 +01:00
parent c6a7b17d22
commit 90c4b223dd
9 changed files with 27 additions and 9 deletions

View file

@ -4,6 +4,7 @@ import "serverinfo_cardcounter.proto";
message ServerInfo_Card {
optional sint32 id = 1 [default = -1];
optional string name = 2;
optional string uuid = 17;
optional sint32 x = 3 [default = -1];
optional sint32 y = 4 [default = -1];
optional bool face_down = 5;

View file

@ -27,8 +27,8 @@
#include <QVariant>
Server_Card::Server_Card(QString _name, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone)
: zone(_zone), id(_id), coord_x(_coord_x), coord_y(_coord_y), name(_name), tapped(false), attacking(false),
Server_Card::Server_Card(QString _name, QString _uuid, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone)
: zone(_zone), id(_id), coord_x(_coord_x), coord_y(_coord_y), name(_name), uuid(_uuid), tapped(false), attacking(false),
facedown(false), color(), ptString(), annotation(), destroyOnZoneChange(false), doesntUntap(false), parentCard(0),
stashedCard(nullptr)
{

View file

@ -39,6 +39,7 @@ private:
int id;
int coord_x, coord_y;
QString name;
QString uuid;
QMap<int, int> counters;
bool tapped;
bool attacking;
@ -54,7 +55,7 @@ private:
Server_Card *stashedCard;
public:
Server_Card(QString _name, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone = nullptr);
Server_Card(QString _name, QString _uuid, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone = nullptr);
~Server_Card() override;
Server_CardZone *getZone() const
@ -70,6 +71,10 @@ public:
{
return id;
}
QString getUUID() const
{
return uuid;
}
int getX() const
{
return coord_x;