Package mage.view

Examples of mage.view.TableView


        ArrayList<MatchView> matchList = new ArrayList<>();
        List<Table> allTables = new ArrayList<>(tables.values());
        Collections.sort(allTables, new TableListSorter());
        for (Table table: allTables) {
            if (table.getState() != TableState.FINISHED) {
                tableList.add(new TableView(table));
            }
            else if (matchList.size() < 50) {
                 if (table.isTournament()) {
                    matchList.add(new MatchView(table));
                } else {
View Full Code Here


    @Override
    public TableView createTable(UUID userId, MatchOptions options) {
        Table table = TableManager.getInstance().createTable(this.getRoomId(), userId, options);
        tables.put(table.getId(), table);
        return new TableView(table);
    }
View Full Code Here

    @Override
    public TableView createTournamentTable(UUID userId, TournamentOptions options) {
        Table table = TableManager.getInstance().createTournamentTable(this.getRoomId(), userId, options);
        tables.put(table.getId(), table);
        return new TableView(table);
    }
View Full Code Here

    }

    @Override
    public TableView getTable(UUID tableId) {
        if (tables.containsKey(tableId)) {
            return new TableView(tables.get(tableId));
        }
        return null;
    }
View Full Code Here

        private void btnNewTournamentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNewTournamentActionPerformed
            newTournamentDialog.showDialog(roomId);
}//GEN-LAST:event_btnNewTournamentActionPerformed

        private void btnQuickStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuickStartActionPerformed
            TableView table;
            try {
                File f = new File("test.dck");
                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());
            } catch (HeadlessException ex) {
                handleError(ex);
            }
}//GEN-LAST:event_btnQuickStartActionPerformed
View Full Code Here

        return null;
    }

    @Override
    protected void process(List<TableView> view) {
        TableView tableView = view.get(0);
        if (count == 0) {
            count = getPlayersCount(tableView);
        } else {
            int current = getPlayersCount(tableView);
            if (current != count) {
View Full Code Here

TOP

Related Classes of mage.view.TableView

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.