Package mage.view

Examples of mage.view.GameTypeView


  public void addGameType(String name, GameType gameType, Class game) {
    if (game != null) {
      this.games.put(name, game);
      this.gameTypes.put(name, gameType);
      this.gameTypeViews.add(new GameTypeView(gameType));
    }
  }
View Full Code Here


    this.playerId = null;
    this.setVisible(false);
  }//GEN-LAST:event_btnCancelActionPerformed

  private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
    GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem();
    List<String> playerTypes = new ArrayList<String>();
    playerTypes.add("Human");
    for (TablePlayerPanel player: players) {
      playerTypes.add(player.getPlayerType());
    }
    table = session.createTable(
        roomId,
        gameType.getName(),
        (String)this.cbDeckType.getSelectedItem(),
        playerTypes,
        (MultiplayerAttackOption)this.cbAttackOption.getSelectedItem(),
        (RangeOfInfluence)this.cbRange.getSelectedItem());
    try {
View Full Code Here

    int numPlayers = (Integer)this.spnNumPlayers.getValue() - 1;
    createPlayers(numPlayers);
  }//GEN-LAST:event_numPlayersChanged

  private void setGameOptions() {
    GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem();
    this.spnNumPlayers.setModel(new SpinnerNumberModel(gameType.getMinPlayers(), gameType.getMinPlayers(), gameType.getMaxPlayers(), 1));
    this.spnNumPlayers.setEnabled(gameType.getMinPlayers() != gameType.getMaxPlayers());
    this.cbAttackOption.setEnabled(gameType.isUseAttackOption());
    this.cbRange.setEnabled(gameType.isUseRange());
    createPlayers(gameType.getMinPlayers() - 1);
  }
View Full Code Here

            Session session = new SessionImpl(mageClient);

            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,"")) {
View Full Code Here

        session.connect(connection);

        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,"")) {
View Full Code Here

    public void addGameType(String name, MatchType matchType, Class game) {
        if (game != null) {
            this.games.put(name, game);
            this.gameTypes.put(name, matchType);
            this.gameTypeViews.add(new GameTypeView(matchType));
        }
    }
View Full Code Here

        this.playerId = null;
        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());
View Full Code Here

    private void spnNumWinsnumPlayersChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnNumWinsnumPlayersChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_spnNumWinsnumPlayersChanged

    private void setGameOptions() {
        GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem();
        int oldValue = (Integer) this.spnNumPlayers.getValue();
        this.spnNumPlayers.setModel(new SpinnerNumberModel(gameType.getMinPlayers(), gameType.getMinPlayers(), gameType.getMaxPlayers(), 1));
        this.spnNumPlayers.setEnabled(gameType.getMinPlayers() != gameType.getMaxPlayers());
        if (oldValue >= gameType.getMinPlayers() && oldValue <= gameType.getMaxPlayers()){
            this.spnNumPlayers.setValue(oldValue);
        }
        this.cbAttackOption.setEnabled(gameType.isUseAttackOption());
        this.cbRange.setEnabled(gameType.isUseRange());
        createPlayers((Integer) spnNumPlayers.getValue() - 1);
    }
View Full Code Here

    private void cbGameTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbGameTypeActionPerformed
        setGameOptions();
    }//GEN-LAST:event_cbGameTypeActionPerformed
    private void setGameOptions() {
        GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem();
//        int oldValue = (Integer) this.spnNumPlayers.getValue();
//        this.spnNumPlayers.setModel(new SpinnerNumberModel(gameType.getMinPlayers(), gameType.getMinPlayers(), gameType.getMaxPlayers(), 1));
//        this.spnNumPlayers.setEnabled(gameType.getMinPlayers() != gameType.getMaxPlayers());
//        if (oldValue >= gameType.getMinPlayers() && oldValue <= gameType.getMaxPlayers()){
//            this.spnNumPlayers.setValue(oldValue);
View Full Code Here

TOP

Related Classes of mage.view.GameTypeView

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.