mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
phases toolbar fix; face down fix
This commit is contained in:
parent
85319ecc28
commit
33ccbe3c00
5 changed files with 48 additions and 12 deletions
|
|
@ -493,3 +493,34 @@ void Game::queryGameState()
|
|||
connect(pc, SIGNAL(cardListReceived(QList<ServerZoneCard>)), this, SLOT(cardListReceived(QList<ServerZoneCard>)));
|
||||
connect(pc, SIGNAL(counterListReceived(QList<ServerCounter>)), this, SLOT(counterListReceived(QList<ServerCounter>)));
|
||||
}
|
||||
|
||||
void Game::activePlayerDrawCard()
|
||||
{
|
||||
Player *p = getActiveLocalPlayer();
|
||||
if (p)
|
||||
p->actDrawCard();
|
||||
}
|
||||
|
||||
void Game::activePlayerUntapAll()
|
||||
{
|
||||
Player *p = getActiveLocalPlayer();
|
||||
if (p)
|
||||
p->actUntapAll();
|
||||
}
|
||||
|
||||
Player *Game::getActiveLocalPlayer() const
|
||||
{
|
||||
int localPlayerCount = 0;
|
||||
QMapIterator<int, Player *> i(players);
|
||||
while (i.hasNext())
|
||||
if (i.next().value()->getLocal())
|
||||
++localPlayerCount;
|
||||
|
||||
i.toFront();
|
||||
while (i.hasNext()) {
|
||||
Player *p = i.next().value();
|
||||
if (p->getLocal() && (p->getActive() || (localPlayerCount == 1)))
|
||||
return p;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue