mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
refactor(client): use ZoneNames constants in core player/zone logic
Update the foundational player and zone classes to use ZoneNames:: constants instead of string literals. Changes include: - player.h/cpp: zone initialization and builtinZones set - card_zone_logic.cpp: zone name translation for UI display - table_zone.cpp: table zone operations No functional changes - purely mechanical string literal replacement.
This commit is contained in:
parent
be140bd1d6
commit
c50fb0d137
4 changed files with 27 additions and 24 deletions
|
|
@ -61,15 +61,15 @@ void Player::forwardActionSignalsToEventHandler()
|
|||
|
||||
void Player::initializeZones()
|
||||
{
|
||||
addZone(new PileZoneLogic(this, "deck", false, true, false, this));
|
||||
addZone(new PileZoneLogic(this, "grave", false, false, true, this));
|
||||
addZone(new PileZoneLogic(this, "rfg", false, false, true, this));
|
||||
addZone(new PileZoneLogic(this, "sb", false, false, false, this));
|
||||
addZone(new TableZoneLogic(this, "table", true, false, true, this));
|
||||
addZone(new StackZoneLogic(this, "stack", true, false, true, this));
|
||||
addZone(new PileZoneLogic(this, ZoneNames::DECK, false, true, false, this));
|
||||
addZone(new PileZoneLogic(this, ZoneNames::GRAVE, false, false, true, this));
|
||||
addZone(new PileZoneLogic(this, ZoneNames::EXILE, false, false, true, this));
|
||||
addZone(new PileZoneLogic(this, ZoneNames::SIDEBOARD, false, false, false, this));
|
||||
addZone(new TableZoneLogic(this, ZoneNames::TABLE, true, false, true, this));
|
||||
addZone(new StackZoneLogic(this, ZoneNames::STACK, true, false, true, this));
|
||||
bool visibleHand = playerInfo->getLocalOrJudge() ||
|
||||
(game->getPlayerManager()->isSpectator() && game->getGameMetaInfo()->spectatorsOmniscient());
|
||||
addZone(new HandZoneLogic(this, "hand", false, false, visibleHand, this));
|
||||
addZone(new HandZoneLogic(this, ZoneNames::HAND, false, false, visibleHand, this));
|
||||
}
|
||||
|
||||
Player::~Player()
|
||||
|
|
@ -119,13 +119,13 @@ void Player::setZoneId(int _zoneId)
|
|||
void Player::processPlayerInfo(const ServerInfo_Player &info)
|
||||
{
|
||||
static QSet<QString> builtinZones{/* PileZones */
|
||||
"deck", "grave", "rfg", "sb",
|
||||
ZoneNames::DECK, ZoneNames::GRAVE, ZoneNames::EXILE, ZoneNames::SIDEBOARD,
|
||||
/* TableZone */
|
||||
"table",
|
||||
ZoneNames::TABLE,
|
||||
/* StackZone */
|
||||
"stack",
|
||||
ZoneNames::STACK,
|
||||
/* HandZone */
|
||||
"hand"};
|
||||
ZoneNames::HAND};
|
||||
clearCounters();
|
||||
clearArrows();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue