zoneId is a dynamic gameplay property and thus belongs in player.cpp

Took 11 minutes

Took 19 seconds
This commit is contained in:
Lukas Brübach 2025-09-10 03:09:49 +02:00
parent 270bdefd87
commit aaf3c1e3b2
11 changed files with 31 additions and 32 deletions

View file

@ -32,7 +32,7 @@
Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, Game *_parent)
: QObject(_parent), game(_parent), playerInfo(new PlayerInfo(info, _id, _local, _judge)),
playerEventHandler(new PlayerEventHandler(this)), playerActions(new PlayerActions(this)), active(false),
conceded(false), deck(nullptr), dialogSemaphore(false)
conceded(false), deck(nullptr), zoneId(0), dialogSemaphore(false)
{
initializeZones();
@ -44,7 +44,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, G
connect(this, &Player::deckChanged, playerMenu, &PlayerMenu::enableOpenInDeckEditorAction);
connect(this, &Player::deckChanged, playerMenu, &PlayerMenu::populatePredefinedTokensMenu);
// connect(this, &Player::openDeckEditor, game, &TabGame::openDeckEditor);
connect(this, &Player::openDeckEditor, game->getTab(), &TabGame::openDeckEditor);
}
void Player::initializeZones()
@ -109,6 +109,12 @@ void Player::setConceded(bool _conceded)
}
}
void Player::setZoneId(int _zoneId)
{
zoneId = _zoneId;
graphicsItem->getPlayerArea()->setPlayerZoneId(zoneId);
}
void Player::processPlayerInfo(const ServerInfo_Player &info)
{
static QSet<QString> builtinZones{/* PileZones */