Package com.barrybecker4.game.twoplayer.common

Examples of com.barrybecker4.game.twoplayer.common.TwoPlayerOptions


     * The dialog needs the user to dismiss it when done.
     * It is not shown if all computer players.
     * @param battle  the battle to show in a separate dialog
     */
    private void showBattle(BattleSimulation battle) {
        BattleDialog bDlg = new BattleDialog(parent_, battle, this);
        //bDlg.setLocationRelativeTo(this);

        Point p = this.getParent().getLocationOnScreen();
        // offset the dlg so the Galaxy grid is visible as a reference.
        bDlg.setLocation((int) (p.getX() + getParent().getWidth()),
                         (int) (p.getY() + 0.65 * getParent().getHeight()));
        bDlg.setModal(true);
        bDlg.setVisible(true);
    }
View Full Code Here


    }

    @Override
    protected NewGameDialog createNewGameDialog(Component parent, GameViewModel viewer )
    {
        return new GalacticNewGameDialog( parent, viewer );
    }
View Full Code Here

    }

    @Override
    protected GameOptionsDialog createOptionsDialog(Component parent, GameController controller )
    {
        return new GalacticOptionsDialog( parent, controller );
    }
View Full Code Here

     * display a dialog at the end of the game showing who won and other relevant
     * game specific information.
     */
    @Override
    public void showWinnerDialog() {
        GalacticTallyDialog tallyDialog = new GalacticTallyDialog(parent_, (GalacticController)controller_);
        tallyDialog.showDialog();
    }
View Full Code Here

     */
    private void showOrdersDialog(GalacticController gc) {

        GalacticPlayer currentPlayer = (GalacticPlayer)gc.getCurrentPlayer();

        OrdersDialog ordersDialog =
                new OrdersDialog(null, currentPlayer, gc.getNumberOfYearsRemaining());
        Point p = getParent().getLocationOnScreen();

        // offset the dlg so the Galaxy grid is visible as a reference
        ordersDialog.setLocation((int)(p.getX()+0.7*getParent().getWidth()), (int)(p.getY()+getParent().getHeight()/3.0));

        boolean canceled = ordersDialog.showDialog();
        if ( !canceled ) { // newGame a game with the newly defined options
            currentPlayer.setOrders( ordersDialog.getOrders() );
            gc.advanceToNextPlayer();
        }
    }
View Full Code Here

        weights_ = new CheckersWeights();
    }

    @Override
    protected TwoPlayerOptions createOptions() {
        return new TwoPlayerOptions();
    }
View Full Code Here

        player1sTurn_ = false;
    }

    @Override
    protected TwoPlayerOptions createOptions() {
        return new TwoPlayerOptions();
    }
View Full Code Here

        // we create a separate controller for the TreeDialog so it can browse without
        // disturbing the state of the actual game.
        treeDialog_ = createGameTreeDialog();

        TwoPlayerOptions options = get2PlayerController().getTwoPlayerOptions();
        GameContext.log(2, "2player pane init  get2PlayerController().getShowGameTree() ="
                + options.getShowGameTree() );
        if (options.getShowGameTree()) {
            showGameTreeDialog();
        }
    }
View Full Code Here

    }

    @Override
    public GameOptions getOptions() {

        TwoPlayerOptions options = getTwoPlayerOptions();

        options.setShowGameTree(gameTreeCheckbox_.isSelected() );
        return options;
    }
View Full Code Here

        addDebugLevel(p);
        addLoggerSection(p);
        addProfileCheckBox(p);

        // show game tree option
        TwoPlayerOptions options = get2PlayerController().getTwoPlayerOptions();
        gameTreeCheckbox_ = new JCheckBox(GameContext.getLabel("SHOW_GAME_TREE"), options.getShowGameTree());
        gameTreeCheckbox_.setToolTipText( GameContext.getLabel("SHOW_GAME_TREE_TIP") );
        gameTreeCheckbox_.addActionListener( this );
        gameTreeCheckbox_.setAlignmentX( Component.LEFT_ALIGNMENT );
        p.add( gameTreeCheckbox_ );
View Full Code Here

TOP

Related Classes of com.barrybecker4.game.twoplayer.common.TwoPlayerOptions

Copyright © 2018 www.massapicom. 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.