Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2
This commit is contained in:
		@@ -88,7 +88,7 @@ public class MdgaApp extends SimpleApplication {
 | 
			
		||||
    private final TimerManager timerManager = new TimerManager();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public static final int DEBUG_MULTIPLIER = 1;
 | 
			
		||||
    public static final int DEBUG_MULTIPLIER = 0;
 | 
			
		||||
 | 
			
		||||
    public MdgaApp() {
 | 
			
		||||
        networkConnection = new NetworkSupport(this);
 | 
			
		||||
@@ -351,5 +351,9 @@ public GameView getGameView() {
 | 
			
		||||
    public TimerManager getTimerManager() {
 | 
			
		||||
        return timerManager;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public CeremonyView getCeremonyView() {
 | 
			
		||||
        return ceremonyView;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -144,6 +144,10 @@ public void enter(MdgaState state) {
 | 
			
		||||
        //app.enter(state);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void next() {
 | 
			
		||||
        app.getGameLogic().selectNext();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setSwap(boolean swap) {
 | 
			
		||||
        this.swap = swap;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -133,8 +133,7 @@ private void handleGame(Notification notification) {
 | 
			
		||||
            app.getAcousticHandler().playSound(MdgaSound.UI90);
 | 
			
		||||
            delay = STANDARD_DELAY;
 | 
			
		||||
        } else if (notification instanceof CeremonyNotification ceremonyNotification) {
 | 
			
		||||
            app.enter(MdgaState.CEREMONY);
 | 
			
		||||
            CeremonyView ceremonyView = (CeremonyView) app.getView();
 | 
			
		||||
            CeremonyView ceremonyView = app.getCeremonyView();
 | 
			
		||||
            int size = ceremonyNotification.getNames().size();
 | 
			
		||||
 | 
			
		||||
            if (ceremonyNotification.getPiecesThrown().size() != size ||
 | 
			
		||||
@@ -162,6 +161,7 @@ private void handleGame(Notification notification) {
 | 
			
		||||
 | 
			
		||||
                ceremonyView.addStatisticsRow(name, v1, v2, v3, v4, v5, v6);
 | 
			
		||||
            }
 | 
			
		||||
            app.enter(MdgaState.CEREMONY);
 | 
			
		||||
        } else if (notification instanceof DiceNowNotification) {
 | 
			
		||||
            guiHandler.hideText();
 | 
			
		||||
            guiHandler.showDice();
 | 
			
		||||
 
 | 
			
		||||
@@ -184,7 +184,7 @@ public void forward() {
 | 
			
		||||
                enterSub(SubState.STATISTICS);
 | 
			
		||||
                break;
 | 
			
		||||
            case STATISTICS:
 | 
			
		||||
                app.getModelSynchronize().enter(MdgaState.MAIN);
 | 
			
		||||
                app.getModelSynchronize().next();
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -205,7 +205,7 @@ public void addCeremonyParticipant(Color color, int pos, String name) {
 | 
			
		||||
 | 
			
		||||
        ceremonyButtons.add(button);
 | 
			
		||||
 | 
			
		||||
        if (state.equals(SubState.AWARD_CEREMONY)) {
 | 
			
		||||
        if (state != null && state.equals(SubState.AWARD_CEREMONY)) {
 | 
			
		||||
            button.hide();
 | 
			
		||||
            button.show();
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,7 @@
 | 
			
		||||
 | 
			
		||||
import pp.mdga.client.ClientGameLogic;
 | 
			
		||||
import pp.mdga.client.ClientState;
 | 
			
		||||
import pp.mdga.notification.StartDialogNotification;
 | 
			
		||||
 | 
			
		||||
public class StatisticsState extends CeremonyStates {
 | 
			
		||||
 | 
			
		||||
@@ -36,6 +37,7 @@ public void exit() {
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void selectNext() {
 | 
			
		||||
        logic.addNotification(new StartDialogNotification());
 | 
			
		||||
        logic.setState(logic.getDialogs());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -11,6 +11,8 @@ public class AnimationState extends GameStates {
 | 
			
		||||
 | 
			
		||||
    private final GameState parent;
 | 
			
		||||
 | 
			
		||||
    private boolean spectator = false;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Constructs a client state of the specified game logic.
 | 
			
		||||
     *
 | 
			
		||||
@@ -34,7 +36,16 @@ public void enter() {
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void exit() {
 | 
			
		||||
        spectator = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets the spectator.
 | 
			
		||||
     *
 | 
			
		||||
     * @param spectator the spectator
 | 
			
		||||
     */
 | 
			
		||||
    public void setSpectator(boolean spectator) {
 | 
			
		||||
        this.spectator = spectator;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -43,6 +54,10 @@ public void exit() {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void selectAnimationEnd() {
 | 
			
		||||
        logic.send(new AnimationEndMessage());
 | 
			
		||||
        parent.setState(parent.getWaiting());
 | 
			
		||||
        if (spectator){
 | 
			
		||||
            parent.setState(parent.getSpectator());
 | 
			
		||||
        } else {
 | 
			
		||||
            parent.setState(parent.getWaiting());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@
 | 
			
		||||
import pp.mdga.client.ClientState;
 | 
			
		||||
import pp.mdga.client.GameState;
 | 
			
		||||
import pp.mdga.game.BonusCard;
 | 
			
		||||
import pp.mdga.game.Node;
 | 
			
		||||
import pp.mdga.game.Piece;
 | 
			
		||||
import pp.mdga.game.PieceState;
 | 
			
		||||
import pp.mdga.game.ShieldState;
 | 
			
		||||
@@ -31,6 +32,7 @@ public SpectatorState(ClientState parent, ClientGameLogic logic) {
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void enter() {
 | 
			
		||||
        parent.getAnimation().setSpectator(true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -42,7 +44,9 @@ public void exit() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Receives the Ceremony Message.
 | 
			
		||||
     * Handles the reception of a CeremonyMessage.
 | 
			
		||||
     *
 | 
			
		||||
     * @param msg the ceremony message
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void received(CeremonyMessage msg) {
 | 
			
		||||
@@ -50,34 +54,30 @@ public void received(CeremonyMessage msg) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Receives the Draw card message.
 | 
			
		||||
     * Handles the reception of a DieMessage.
 | 
			
		||||
     *
 | 
			
		||||
     * @param msg the draw card message
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void received(DrawCardMessage msg) {
 | 
			
		||||
        logic.getGame().getActivePlayer().addHandCard(msg.getCard());
 | 
			
		||||
        if (msg.getCard() instanceof HiddenCard) {
 | 
			
		||||
            logic.addNotification(new DrawCardNotification(logic.getGame().getActiveColor(), BonusCard.HIDDEN));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //stats
 | 
			
		||||
        logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPlayerStatistic().increaseActivatedBonusNodes();
 | 
			
		||||
        logic.getGame().getGameStatistics().increaseActivatedBonusNodes();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Receives the Die Message.
 | 
			
		||||
     * @param msg the die message
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void received(DieMessage msg) {
 | 
			
		||||
        logic.getGame().setDiceEyes(msg.getDiceEye());
 | 
			
		||||
        logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes(), logic.getGame().getDiceEyes() * logic.getGame().getDiceModifier()));
 | 
			
		||||
        parent.setState(parent.getAnimation());
 | 
			
		||||
        if (logic.getGame().getTurboFlag()) {
 | 
			
		||||
            logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), msg.getDiceEye(), logic.getGame().getDiceModifier()));
 | 
			
		||||
        } else {
 | 
			
		||||
            logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), msg.getDiceEye()));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //stats
 | 
			
		||||
        if (msg.getDiceEye() == 6) {
 | 
			
		||||
            logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPlayerStatistic().increaseDiced6();
 | 
			
		||||
            logic.getGame().getGameStatistics().increaseDiced6();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Receives the PlayCardMessage Message.
 | 
			
		||||
     * Handles the reception of a PlayCardMessage.
 | 
			
		||||
     *
 | 
			
		||||
     * @param msg the play card message
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void received(PlayCardMessage msg) {
 | 
			
		||||
@@ -89,28 +89,73 @@ public void received(PlayCardMessage msg) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Receives the ActivePlayerMessage Message.
 | 
			
		||||
     * Handles the reception of an ActivePlayerMessage.
 | 
			
		||||
     *
 | 
			
		||||
     * @param msg the active player message
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void received(ActivePlayerMessage msg) {
 | 
			
		||||
        logic.addNotification(new ActivePlayerNotification(msg.getColor()));
 | 
			
		||||
        logic.getGame().setActiveColor(msg.getColor());
 | 
			
		||||
        parent.setState(parent.getAnimation());
 | 
			
		||||
        if (msg.getColor() == logic.getGame().getPlayers().get(logic.getOwnPlayerId()).getColor()) {
 | 
			
		||||
            parent.setState(parent.getTurn());
 | 
			
		||||
        } else {
 | 
			
		||||
            for (Piece piece : logic.getGame().getActivePlayer().getPieces()) {
 | 
			
		||||
                if (piece.isShielded() || piece.isSuppressed()) {
 | 
			
		||||
                    logic.addNotification(new RemoveShieldNotification(piece.getUuid()));
 | 
			
		||||
                    piece.setShield(ShieldState.NONE);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Receives the MoveMessage Message.
 | 
			
		||||
     * Handles the reception of a MoveMessage.
 | 
			
		||||
     *
 | 
			
		||||
     * @param msg the move message
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void received(MoveMessage msg) {
 | 
			
		||||
        Piece piece = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid());
 | 
			
		||||
        if (msg.isHomeMove()) {
 | 
			
		||||
            logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex()));
 | 
			
		||||
            logic.getGame().getBoard().getInfield()[logic.getGame().getBoard().getInfieldIndexOfPiece(piece)].clearOccupant();
 | 
			
		||||
            logic.getGame().getPlayerByColor(piece.getColor()).setPieceInHome(msg.getTargetIndex(), piece);
 | 
			
		||||
            if (piece.getState().equals(PieceState.HOME)) {
 | 
			
		||||
                logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex()));
 | 
			
		||||
                int pieceHomeIndex = logic.getGame().getActivePlayer().getHomeIndexOfPiece(piece);
 | 
			
		||||
                Node pieceNode = logic.getGame().getActivePlayer().getHomeNodes()[pieceHomeIndex];
 | 
			
		||||
 | 
			
		||||
                //gets the oldNode
 | 
			
		||||
                int homeIndex = logic.getGame().getActivePlayer().getHomeIndexOfPiece(piece);
 | 
			
		||||
                Node oldNode = logic.getGame().getActivePlayer().getHomeNodes()[homeIndex];
 | 
			
		||||
                //gets the targetNode
 | 
			
		||||
                Node targetNode = logic.getGame().getActivePlayer().getHomeNodes()[msg.getTargetIndex()];
 | 
			
		||||
                if (msg.getTargetIndex() == logic.getGame().getActivePlayer().getHighestHomeIdx()) {
 | 
			
		||||
                    piece.setState(PieceState.HOMEFINISHED);
 | 
			
		||||
                } else {
 | 
			
		||||
                    piece.setState(PieceState.HOME);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                oldNode.clearOccupant();
 | 
			
		||||
                targetNode.setOccupant(piece);
 | 
			
		||||
 | 
			
		||||
            } else {
 | 
			
		||||
                logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex()));
 | 
			
		||||
                int oldNoteIdx = logic.getGame().getBoard().getInfieldIndexOfPiece(piece);
 | 
			
		||||
                Node oldNode = logic.getGame().getBoard().getInfield()[oldNoteIdx];
 | 
			
		||||
 | 
			
		||||
                //gets the targetNode
 | 
			
		||||
                Node targetNode = logic.getGame().getActivePlayer().getHomeNodes()[msg.getTargetIndex()];
 | 
			
		||||
 | 
			
		||||
                if (msg.getTargetIndex() == logic.getGame().getActivePlayer().getHighestHomeIdx()) {
 | 
			
		||||
                    piece.setState(PieceState.HOMEFINISHED);
 | 
			
		||||
                } else {
 | 
			
		||||
                    piece.setState(PieceState.HOME);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                oldNode.clearOccupant();
 | 
			
		||||
                targetNode.setOccupant(piece);
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            int oldIndex = logic.getGame().getBoard().getInfieldIndexOfPiece(piece);
 | 
			
		||||
 | 
			
		||||
            Piece occ = logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].getOccupant();
 | 
			
		||||
            if (occ != null) {
 | 
			
		||||
                //TODO: MoveThrowNotification
 | 
			
		||||
@@ -122,7 +167,7 @@ public void received(MoveMessage msg) {
 | 
			
		||||
                //set occ to waiting
 | 
			
		||||
                logic.getGame().getPlayerByColor(occ.getColor()).addWaitingPiece(occ);
 | 
			
		||||
            }
 | 
			
		||||
            if (msg.getPiece().getState().equals(PieceState.WAITING)) {
 | 
			
		||||
            if (oldIndex == -1) {
 | 
			
		||||
                logic.addNotification(new MovePieceNotification(piece.getUuid(), msg.getTargetIndex(), true));
 | 
			
		||||
                logic.getGame().getPlayerByColor(piece.getColor()).removeWaitingPiece(piece);
 | 
			
		||||
                piece.setState(PieceState.ACTIVE);
 | 
			
		||||
@@ -133,7 +178,17 @@ public void received(MoveMessage msg) {
 | 
			
		||||
            }
 | 
			
		||||
            //set new node
 | 
			
		||||
            logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(piece);
 | 
			
		||||
            if (logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].isStart()) {
 | 
			
		||||
                if (piece.isShielded()) {
 | 
			
		||||
                    piece.setShield(ShieldState.SUPPRESSED);
 | 
			
		||||
                    logic.addNotification(new ShieldSuppressedNotification(piece.getUuid()));
 | 
			
		||||
                }
 | 
			
		||||
            } else if (piece.isSuppressed()) {
 | 
			
		||||
                piece.setShield(ShieldState.ACTIVE);
 | 
			
		||||
                logic.addNotification(new ShieldActiveNotification(piece.getUuid()));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        System.out.println("send AnimationEndMessage");
 | 
			
		||||
        logic.getGame().setTurboFlag(false);
 | 
			
		||||
        parent.setState(parent.getAnimation());
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -109,6 +109,16 @@ public void received(EndOfTurnMessage msg) {
 | 
			
		||||
        currentState.received(msg);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Receives the dice now message.
 | 
			
		||||
     *
 | 
			
		||||
     * @param msg the dice now message
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void received(DiceNowMessage msg) {
 | 
			
		||||
        currentState.received(msg);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Receives the move message.
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@
 | 
			
		||||
import pp.mdga.game.Piece;
 | 
			
		||||
import pp.mdga.game.PieceState;
 | 
			
		||||
import pp.mdga.game.Player;
 | 
			
		||||
import pp.mdga.game.card.PowerCard;
 | 
			
		||||
import pp.mdga.message.client.*;
 | 
			
		||||
import pp.mdga.message.server.*;
 | 
			
		||||
import pp.mdga.server.ServerGameLogic;
 | 
			
		||||
@@ -51,7 +52,12 @@ public void exit() {
 | 
			
		||||
    public void initializeGame() {
 | 
			
		||||
        for (var player : this.logic.getGame().getPlayers().values()) {
 | 
			
		||||
            player.initialize();
 | 
			
		||||
            player.addHandCard(this.logic.getGame().draw());
 | 
			
		||||
            PowerCard card = this.logic.getGame().draw();
 | 
			
		||||
            if (card == null) {
 | 
			
		||||
                this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7));
 | 
			
		||||
            } else {
 | 
			
		||||
                player.addHandCard(card);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Piece piece = player.getPieces()[0];
 | 
			
		||||
            player.getWaitingArea()[0] = null;
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@
 | 
			
		||||
import pp.mdga.game.card.PowerCard;
 | 
			
		||||
import pp.mdga.message.client.RequestMoveMessage;
 | 
			
		||||
import pp.mdga.message.server.DrawCardMessage;
 | 
			
		||||
import pp.mdga.message.server.IncorrectRequestMessage;
 | 
			
		||||
import pp.mdga.message.server.MoveMessage;
 | 
			
		||||
import pp.mdga.message.server.SelectPieceMessage;
 | 
			
		||||
import pp.mdga.server.ServerGameLogic;
 | 
			
		||||
@@ -137,13 +138,21 @@ public void received(RequestMoveMessage msg, int from) {
 | 
			
		||||
        if (targetNode.isBonus()) {
 | 
			
		||||
            logic.getGame().getActivePlayer().getPlayerStatistic().increaseActivatedBonusNodes();
 | 
			
		||||
            logic.getGame().getGameStatistics().increaseActivatedBonusNodes();
 | 
			
		||||
            PowerCard cardToDraw = logic.getGame().draw();
 | 
			
		||||
            for (Player p : logic.getGame().getPlayersAsList()) {
 | 
			
		||||
                if (p.getColor() == logic.getGame().getActiveColor()) {
 | 
			
		||||
                    PowerCard cardToDraw = logic.getGame().draw();
 | 
			
		||||
                    p.addHandCard(cardToDraw);
 | 
			
		||||
                    logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw));
 | 
			
		||||
                    if (cardToDraw == null) {
 | 
			
		||||
                        this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7));
 | 
			
		||||
                    } else {
 | 
			
		||||
                        p.addHandCard(cardToDraw);
 | 
			
		||||
                        logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw));
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard()));
 | 
			
		||||
                    if (cardToDraw == null) {
 | 
			
		||||
                        this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7));
 | 
			
		||||
                    } else {
 | 
			
		||||
                        logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard()));
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@
 | 
			
		||||
import pp.mdga.game.card.PowerCard;
 | 
			
		||||
import pp.mdga.message.client.RequestMoveMessage;
 | 
			
		||||
import pp.mdga.message.server.DrawCardMessage;
 | 
			
		||||
import pp.mdga.message.server.IncorrectRequestMessage;
 | 
			
		||||
import pp.mdga.message.server.MoveMessage;
 | 
			
		||||
import pp.mdga.message.server.StartPieceMessage;
 | 
			
		||||
import pp.mdga.server.ServerGameLogic;
 | 
			
		||||
@@ -70,13 +71,21 @@ public void received(RequestMoveMessage msg, int from) {
 | 
			
		||||
            if (targetNode.isBonus()) {
 | 
			
		||||
                logic.getGame().getActivePlayer().getPlayerStatistic().increaseActivatedBonusNodes();
 | 
			
		||||
                logic.getGame().getGameStatistics().increaseActivatedBonusNodes();
 | 
			
		||||
                PowerCard cardToDraw = logic.getGame().draw();
 | 
			
		||||
                for (Player p : logic.getGame().getPlayersAsList()) {
 | 
			
		||||
                    if (p.getColor() == logic.getGame().getActiveColor()) {
 | 
			
		||||
                        PowerCard cardToDraw = logic.getGame().draw();
 | 
			
		||||
                        p.addHandCard(cardToDraw);
 | 
			
		||||
                        logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw));
 | 
			
		||||
                        if (cardToDraw == null) {
 | 
			
		||||
                            this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7));
 | 
			
		||||
                        } else {
 | 
			
		||||
                            p.addHandCard(cardToDraw);
 | 
			
		||||
                            logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw));
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard()));
 | 
			
		||||
                        if (cardToDraw == null) {
 | 
			
		||||
                            this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7));
 | 
			
		||||
                        } else {
 | 
			
		||||
                            logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard()));
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@ incorrect.request.3=Selected to many or wrong pieces.
 | 
			
		||||
incorrect.request.4=Did not select exactly 2 pieces or selected wrong pieces.
 | 
			
		||||
incorrect.request.5=Cannot start game because not everyone is ready.
 | 
			
		||||
incorrect.request.6=You are alone in this Lobby.
 | 
			
		||||
incorrect.request.7=The draw pile is empty.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,3 +7,4 @@ incorrect.request.3=Du hast zuviele, oder eine falsche Figur ausgew
 | 
			
		||||
incorrect.request.4=Du hast nicht genau zwei Figuren, oder falsche Figuren ausgewählt.
 | 
			
		||||
incorrect.request.5=Du kannst das Spiel nicht starten, da nicht alle Spieler bereit sind.
 | 
			
		||||
incorrect.request.6=Du bist alleine in dieser Lobby.
 | 
			
		||||
incorrect.request.7=Der Nachziehstapel ist leer.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user