mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
Remove extra method
Took 2 minutes
This commit is contained in:
parent
a4af9640c9
commit
c27325222f
3 changed files with 10 additions and 16 deletions
|
|
@ -82,7 +82,6 @@ void GameScene::addPlayer(PlayerLogic *player)
|
||||||
{
|
{
|
||||||
qCInfo(GameScenePlayerAdditionRemovalLog) << "GameScene::addPlayer name=" << player->getPlayerInfo()->getName();
|
qCInfo(GameScenePlayerAdditionRemovalLog) << "GameScene::addPlayer name=" << player->getPlayerInfo()->getName();
|
||||||
|
|
||||||
players << player->getGraphicsItem();
|
|
||||||
playerViews.insert(player->getPlayerInfo()->getId(), player->getGraphicsItem());
|
playerViews.insert(player->getPlayerInfo()->getId(), player->getGraphicsItem());
|
||||||
addItem(player->getGraphicsItem());
|
addItem(player->getGraphicsItem());
|
||||||
connect(player->getGraphicsItem(), &PlayerGraphicsItem::sizeChanged, this, &GameScene::rearrange);
|
connect(player->getGraphicsItem(), &PlayerGraphicsItem::sizeChanged, this, &GameScene::rearrange);
|
||||||
|
|
@ -122,7 +121,6 @@ void GameScene::removePlayer(PlayerLogic *player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto *view = playerViews.take(player->getPlayerInfo()->getId());
|
auto *view = playerViews.take(player->getPlayerInfo()->getId());
|
||||||
players.removeOne(view);
|
|
||||||
removeItem(view);
|
removeItem(view);
|
||||||
rearrange();
|
rearrange();
|
||||||
}
|
}
|
||||||
|
|
@ -204,7 +202,7 @@ QList<PlayerLogic *> GameScene::collectActivePlayers(int &firstPlayerIndex) cons
|
||||||
firstPlayerIndex = 0;
|
firstPlayerIndex = 0;
|
||||||
bool firstPlayerFound = false;
|
bool firstPlayerFound = false;
|
||||||
|
|
||||||
for (auto *pgItem : players) {
|
for (auto *pgItem : playerViews.values()) {
|
||||||
PlayerLogic *p = pgItem->getPlayer();
|
PlayerLogic *p = pgItem->getPlayer();
|
||||||
if (p && !p->getConceded()) {
|
if (p && !p->getConceded()) {
|
||||||
activePlayers.append(p);
|
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 *startView = playerViews.value(data.startPlayerId);
|
||||||
auto *targetView = playerViews.value(data.targetPlayerId);
|
auto *targetView = playerViews.value(data.targetPlayerId);
|
||||||
|
|
|
||||||
|
|
@ -43,16 +43,15 @@ private:
|
||||||
static const int playerAreaSpacing = 5; ///< Space between player areas
|
static const int playerAreaSpacing = 5; ///< Space between player areas
|
||||||
|
|
||||||
PhasesToolbar *phasesToolbar; ///< Toolbar showing game phases
|
PhasesToolbar *phasesToolbar; ///< Toolbar showing game phases
|
||||||
QList<PlayerGraphicsItem *> players; ///< All player graphics items
|
QMap<int, PlayerGraphicsItem *> playerViews; ///< ID lookup for player graphics items
|
||||||
QMap<int, PlayerGraphicsItem *> playerViews; ///< ID lookup
|
|
||||||
QList<QList<PlayerGraphicsItem *>> playersByColumn; ///< Players organized by column
|
QList<QList<PlayerGraphicsItem *>> playersByColumn; ///< Players organized by column
|
||||||
QMap<int, ArrowItem *> arrowRegistry;
|
QMap<int, ArrowItem *> arrowRegistry; ///< ID registry for arrow graphics items
|
||||||
QList<ZoneViewWidget *> zoneViews; ///< Active zone view widgets
|
QList<ZoneViewWidget *> zoneViews; ///< Active zone view widgets
|
||||||
QSize viewSize; ///< Current view size
|
QSize viewSize; ///< Current view size
|
||||||
QPointer<CardItem> hoveredCard; ///< Currently hovered card
|
QPointer<CardItem> hoveredCard; ///< Currently hovered card
|
||||||
QBasicTimer *animationTimer; ///< Timer for card animations
|
QBasicTimer *animationTimer; ///< Timer for card animations
|
||||||
QSet<CardItem *> cardsToAnimate; ///< Cards currently animating
|
QSet<CardItem *> cardsToAnimate; ///< Cards currently animating
|
||||||
int playerRotation; ///< Rotation offset for player layout
|
int playerRotation; ///< Rotation offset for player layout
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Updates which card is currently hovered based on scene coordinates.
|
* @brief Updates which card is currently hovered based on scene coordinates.
|
||||||
|
|
|
||||||
|
|
@ -245,12 +245,9 @@ private:
|
||||||
int zoneId;
|
int zoneId;
|
||||||
QMap<QString, CardZoneLogic *> zones;
|
QMap<QString, CardZoneLogic *> zones;
|
||||||
QMap<int, CounterState *> counters;
|
QMap<int, CounterState *> counters;
|
||||||
QMap<int, ArrowItem *> arrows;
|
|
||||||
|
|
||||||
bool dialogSemaphore;
|
bool dialogSemaphore;
|
||||||
QList<CardItem *> cardsToDelete;
|
QList<CardItem *> cardsToDelete;
|
||||||
|
|
||||||
// void eventConnectionStateChanged(const Event_ConnectionStateChanged &event);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class AnnotationDialog : public QInputDialog
|
class AnnotationDialog : public QInputDialog
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue