Remove extra method

Took 2 minutes
This commit is contained in:
Lukas Brübach 2026-05-21 20:20:29 +02:00
parent a4af9640c9
commit c27325222f
3 changed files with 10 additions and 16 deletions

View file

@ -82,7 +82,6 @@ void GameScene::addPlayer(PlayerLogic *player)
{
qCInfo(GameScenePlayerAdditionRemovalLog) << "GameScene::addPlayer name=" << player->getPlayerInfo()->getName();
players << player->getGraphicsItem();
playerViews.insert(player->getPlayerInfo()->getId(), player->getGraphicsItem());
addItem(player->getGraphicsItem());
connect(player->getGraphicsItem(), &PlayerGraphicsItem::sizeChanged, this, &GameScene::rearrange);
@ -122,7 +121,6 @@ void GameScene::removePlayer(PlayerLogic *player)
}
}
auto *view = playerViews.take(player->getPlayerInfo()->getId());
players.removeOne(view);
removeItem(view);
rearrange();
}
@ -204,7 +202,7 @@ QList<PlayerLogic *> GameScene::collectActivePlayers(int &firstPlayerIndex) cons
firstPlayerIndex = 0;
bool firstPlayerFound = false;
for (auto *pgItem : players) {
for (auto *pgItem : playerViews.values()) {
PlayerLogic *p = pgItem->getPlayer();
if (p && !p->getConceded()) {
activePlayers.append(p);
@ -368,7 +366,7 @@ void GameScene::resizeColumnsAndPlayers(const QList<qreal> &minWidthByColumn, qr
}
}
void GameScene::onArrowCreateRequested(ArrowData data)
void GameScene::onArrowCreateRequested(const ArrowData &data)
{
auto *startView = playerViews.value(data.startPlayerId);
auto *targetView = playerViews.value(data.targetPlayerId);

View file

@ -43,16 +43,15 @@ private:
static const int playerAreaSpacing = 5; ///< Space between player areas
PhasesToolbar *phasesToolbar; ///< Toolbar showing game phases
QList<PlayerGraphicsItem *> players; ///< All player graphics items
QMap<int, PlayerGraphicsItem *> playerViews; ///< ID lookup
QMap<int, PlayerGraphicsItem *> playerViews; ///< ID lookup for player graphics items
QList<QList<PlayerGraphicsItem *>> playersByColumn; ///< Players organized by column
QMap<int, ArrowItem *> arrowRegistry;
QList<ZoneViewWidget *> zoneViews; ///< Active zone view widgets
QSize viewSize; ///< Current view size
QPointer<CardItem> hoveredCard; ///< Currently hovered card
QBasicTimer *animationTimer; ///< Timer for card animations
QSet<CardItem *> cardsToAnimate; ///< Cards currently animating
int playerRotation; ///< Rotation offset for player layout
QMap<int, ArrowItem *> arrowRegistry; ///< ID registry for arrow graphics items
QList<ZoneViewWidget *> zoneViews; ///< Active zone view widgets
QSize viewSize; ///< Current view size
QPointer<CardItem> hoveredCard; ///< Currently hovered card
QBasicTimer *animationTimer; ///< Timer for card animations
QSet<CardItem *> cardsToAnimate; ///< Cards currently animating
int playerRotation; ///< Rotation offset for player layout
/**
* @brief Updates which card is currently hovered based on scene coordinates.

View file

@ -245,12 +245,9 @@ private:
int zoneId;
QMap<QString, CardZoneLogic *> zones;
QMap<int, CounterState *> counters;
QMap<int, ArrowItem *> arrows;
bool dialogSemaphore;
QList<CardItem *> cardsToDelete;
// void eventConnectionStateChanged(const Event_ConnectionStateChanged &event);
};
class AnnotationDialog : public QInputDialog