Examples of GalaxyViewer


Examples of com.barrybecker4.game.multiplayer.galactic.ui.GalaxyViewer

    /**
     * Advance to the next player turn in order.
     */
    @Override
    protected void doAdvanceToNextPlayer() {
        GalaxyViewer gviewer  = (GalaxyViewer)this.getViewer();

        // show message when done.
        if (isDone()) {
            GameContext.log(1, "advanceToNextPlayer done");
            ((GameBoardViewer)getViewer()).sendGameChangedEvent(null);
        }
        advanceToNextPlayerIndex();

        if (getCurrentPlayer() == getPlayers().getFirstPlayer()) {

            // @@ I would really like to
            // Precalculate the battle sequence on the server and store it in the move, then send
            // the result in the move to the client.
            // however, there are problems with that, so I just calculate it in the veiwer for now.

            GalacticTurn gmove = gviewer.createMove(getLastMove());
            //gviewer.showMove(gmove);

            // records the result on the board.
            makeMove(gmove);
        }

        if (!getCurrentPlayer().isHuman()) {
            gviewer.doComputerMove(getCurrentPlayer());
        }

        // fire game changed event
        ((GameBoardViewer)getViewer()).sendGameChangedEvent(null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.