mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
[Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem (#6944)
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem Took 4 minutes Took 48 seconds * Drop early return. Took 1 hour 13 minutes Took 2 minutes Took 1 minute * Delete player view. Took 37 seconds * Restore card counter color in menu. Took 5 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
e674a39b87
commit
9e03f82616
28 changed files with 538 additions and 368 deletions
|
|
@ -35,14 +35,6 @@ PlayerLogic::PlayerLogic(const ServerInfo_User &info, int _id, bool _local, bool
|
|||
conceded(false), zoneId(0), dialogSemaphore(false)
|
||||
{
|
||||
initializeZones();
|
||||
|
||||
playerMenu = new PlayerMenu(this);
|
||||
graphicsItem = new PlayerGraphicsItem(this);
|
||||
playerMenu->setMenusForGraphicItems();
|
||||
|
||||
connect(this, &PlayerLogic::activeChanged, graphicsItem, &PlayerGraphicsItem::onPlayerActiveChanged);
|
||||
|
||||
connect(this, &PlayerLogic::openDeckEditor, game->getTab(), &TabGame::openDeckEditor);
|
||||
}
|
||||
|
||||
void PlayerLogic::initializeZones()
|
||||
|
|
@ -68,7 +60,6 @@ PlayerLogic::~PlayerLogic()
|
|||
}
|
||||
zones.clear();
|
||||
|
||||
delete playerMenu;
|
||||
delete getPlayerInfo()->userInfo;
|
||||
}
|
||||
|
||||
|
|
@ -326,22 +317,16 @@ void PlayerLogic::setActive(bool _active)
|
|||
active = _active;
|
||||
emit activeChanged(active);
|
||||
}
|
||||
void PlayerLogic::onRequestZoneViewToggle(const QString &zoneName, int numberCards, bool isReversed)
|
||||
{
|
||||
emit requestZoneViewToggle(this, zoneName, numberCards, isReversed);
|
||||
}
|
||||
|
||||
void PlayerLogic::updateZones()
|
||||
{
|
||||
getTableZone()->reorganizeCards();
|
||||
}
|
||||
|
||||
PlayerGraphicsItem *PlayerLogic::getGraphicsItem()
|
||||
{
|
||||
return graphicsItem;
|
||||
}
|
||||
|
||||
GameScene *PlayerLogic::getGameScene()
|
||||
{
|
||||
return getGraphicsItem()->getGameScene();
|
||||
}
|
||||
|
||||
void PlayerLogic::setGameStarted()
|
||||
{
|
||||
if (playerInfo->local) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue