mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
arrows: clean all arrows when changing phase; arrow color dependent on modifier keys; remove a single arrow by rightclicking
This commit is contained in:
parent
c57e138a78
commit
897dca2386
8 changed files with 58 additions and 11 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include "server.h"
|
||||
#include "servergame.h"
|
||||
#include "serversocket.h"
|
||||
#include "arrow.h"
|
||||
#include <QSqlQuery>
|
||||
|
||||
ServerGame::ServerGame(ServerSocket *_creator, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, bool _spectatorsAllowed, QObject *parent)
|
||||
|
|
@ -170,6 +171,15 @@ void ServerGame::setActivePlayer(int _activePlayer)
|
|||
|
||||
void ServerGame::setActivePhase(int _activePhase)
|
||||
{
|
||||
for (int i = 0; i < players.size(); ++i) {
|
||||
QMapIterator<int, Arrow *> arrowIterator(players[i]->getArrows());
|
||||
while (arrowIterator.hasNext()) {
|
||||
Arrow *a = arrowIterator.next().value();
|
||||
broadcastEvent(QString("delete_arrow|%1").arg(a->getId()), players[i]);
|
||||
players[i]->deleteArrow(a->getId());
|
||||
}
|
||||
}
|
||||
|
||||
activePhase = _activePhase;
|
||||
broadcastEvent(QString("set_active_phase|%1").arg(_activePhase), NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue