Package mage.game.match

Examples of mage.game.match.MatchOptions


            session.connect(connection);
            UUID roomId = session.getMainRoomId();

            GameTypeView gameTypeView = session.getGameTypes().get(0);
            log.info("Game type view: " + gameTypeView.getName());
            MatchOptions options = createGameOptions(gameTypeView, session);

            TableView table = session.createTable(roomId, options);

            if (!session.joinTable(roomId, table.getTableId(), TEST_USER_NAME + i, "Human", 1, deckList,"")) {
                log.error("Error while joining table");
View Full Code Here


        mageClient.setSession(session);
        UUID roomId = session.getMainRoomId();

        GameTypeView gameTypeView = session.getGameTypes().get(0);
        log.info("Game type view: " + gameTypeView.getName());
        MatchOptions options = createGameOptions(gameTypeView, session);

        TableView table = session.createTable(roomId, options);

        if (!session.joinTable(roomId, table.getTableId(), TEST_USER_NAME + i, "Human", 1, deckList,"")) {
            log.error("Error while joining table");
View Full Code Here

     * @param gameTypeView
     * @param session
     * @return
     */
    private MatchOptions createGameOptions(GameTypeView gameTypeView, Session session) {
        MatchOptions options = new MatchOptions("Test game", gameTypeView.getName());

        options.getPlayerTypes().add("Human");
        options.getPlayerTypes().add("Human");

        options.setDeckType(session.getDeckTypes()[0]);
        options.setLimited(false);
        options.setAttackOption(MultiplayerAttackOption.MULTIPLE);
        options.setRange(RangeOfInfluence.ALL);
        options.setWinsNeeded(1);
        return options;
    }
View Full Code Here

                if (!f.exists()) {
                    JOptionPane.showMessageDialog(null, "Couldn't find test.dck file for quick game start", "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }

                MatchOptions options = new MatchOptions("1", "Two Player Duel");
                options.getPlayerTypes().add("Human");
                options.getPlayerTypes().add("Computer - mad");
                options.setDeckType("Limited");
                options.setAttackOption(MultiplayerAttackOption.LEFT);
                options.setRange(RangeOfInfluence.ALL);
                options.setWinsNeeded(1);
                options.setMatchTimeLimit(MatchTimeLimit.NONE);
                options.setFreeMulligans(2);
                table = session.createTable(roomId,    options);

                session.joinTable(roomId, table.getTableId(), "Human", "Human", 1, DeckImporterUtil.importDeck("test.dck"),"");
                session.joinTable(roomId, table.getTableId(), "Computer", "Computer - mad", 5, DeckImporterUtil.importDeck("test.dck"),"");
                session.startMatch(roomId, table.getTableId());
View Full Code Here

            String[] args = new String[]{"-testMode=true"};
            Main.main(args);
            connect("player", "localhost", 17171);
            UUID roomId = server.getMainRoomId();

            MatchOptions options = new MatchOptions("1", "Two Player Duel");
            options.getPlayerTypes().add("Human");
            options.getPlayerTypes().add("Computer - default");
            options.setDeckType("Limited");
            options.setAttackOption(MultiplayerAttackOption.LEFT);
            options.setRange(RangeOfInfluence.ALL);
            options.setWinsNeeded(1);
            TableView table = server.createTable(sessionId, roomId, options);
            System.out.println("Cards in the deck: " + Sets.loadDeck("UW Control.dck").getCards().size());
            server.joinTable(sessionId, roomId, table.getTableId(), "Human", "Human", Sets.loadDeck("UW Control.dck"));
            server.joinTable(sessionId, roomId, table.getTableId(), "Computer", "Computer - default", Sets.loadDeck("UW Control.dck"));
            server.startMatch(sessionId, roomId, table.getTableId());
View Full Code Here

        this.hideDialog();
    }//GEN-LAST:event_btnCancelActionPerformed

    private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
        GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem();
        MatchOptions options = new MatchOptions(this.txtName.getText(), gameType.getName());
        options.getPlayerTypes().add("Human");
        for (TablePlayerPanel player: players) {
            options.getPlayerTypes().add(player.getPlayerType());
        }
        options.setDeckType((String) this.cbDeckType.getSelectedItem());
        options.setLimited(false);
        options.setMatchTimeLimit((MatchTimeLimit) this.cbTimeLimit.getSelectedItem());
        options.setAttackOption((MultiplayerAttackOption) this.cbAttackOption.getSelectedItem());
        options.setRange((RangeOfInfluence) this.cbRange.getSelectedItem());
        options.setWinsNeeded((Integer)this.spnNumWins.getValue());
        options.setFreeMulligans((Integer)this.spnFreeMulligans.getValue());
        options.setPassword(this.txtPassword.getText());
        saveGameSettingsToPrefs(options, this.player1Panel.getDeckFile());

        table = session.createTable(roomId, options);
        if (table == null) {
            JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Error creating table.", "Error", JOptionPane.ERROR_MESSAGE);
View Full Code Here

TOP

Related Classes of mage.game.match.MatchOptions

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.