mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Refactor: Represent cardName + providerId with CardRef struct (#6039)
* card_ref.h * update CardDatabase signatures * make everything compile * rename methods * add docs * mark stuff const * set cardRef in CardItem * cleanup * fix build failure * Fix builds on mac --------- Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
This commit is contained in:
parent
e05dad4267
commit
a9b3be33e0
61 changed files with 328 additions and 305 deletions
|
|
@ -27,15 +27,9 @@
|
|||
|
||||
#include <QVariant>
|
||||
|
||||
Server_Card::Server_Card(QString _name,
|
||||
QString _provider_id,
|
||||
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), provider_id(_provider_id), tapped(false),
|
||||
attacking(false), facedown(false), color(), ptString(), annotation(), destroyOnZoneChange(false),
|
||||
doesntUntap(false), parentCard(0), stashedCard(nullptr)
|
||||
Server_Card::Server_Card(const CardRef &cardRef, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone)
|
||||
: zone(_zone), id(_id), coord_x(_coord_x), coord_y(_coord_y), cardRef(cardRef), tapped(false), attacking(false),
|
||||
facedown(false), destroyOnZoneChange(false), doesntUntap(false), parentCard(0), stashedCard(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -134,10 +128,10 @@ void Server_Card::setParentCard(Server_Card *_parentCard)
|
|||
|
||||
void Server_Card::getInfo(ServerInfo_Card *info)
|
||||
{
|
||||
QString displayedName = facedown ? QString() : name;
|
||||
QString displayedName = facedown ? QString() : cardRef.name;
|
||||
|
||||
info->set_id(id);
|
||||
info->set_provider_id(provider_id.toStdString());
|
||||
info->set_provider_id(cardRef.providerId.toStdString());
|
||||
info->set_name(displayedName.toStdString());
|
||||
info->set_x(coord_x);
|
||||
info->set_y(coord_y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue