예제 #1
0
  private void buyLevelsButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_buyLevelsButtonActionPerformed
    ArrayList<Treasure> selHidden = getSelectedTreasures(hiddenTreasuresPanel);
    ArrayList<Treasure> selVisible = getSelectedTreasures(visibleTreasuresPanel);

    napakalakiModel.buyLevels(selVisible, selHidden);

    setPlayer(napakalakiModel.getCurrentPlayer());
    repaint();
  } // GEN-LAST:event_buyLevelsButtonActionPerformed
예제 #2
0
  private void makeTreasuresVisibleButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_makeTreasuresVisibleButtonActionPerformed

    ArrayList<Treasure> selHidden = getSelectedTreasures(hiddenTreasuresPanel);

    for (Treasure treasure : selHidden) {
      napakalakiModel.makeTreasureVisible(treasure);
    }

    setPlayer(napakalakiModel.getCurrentPlayer());
    repaint();
  } // GEN-LAST:event_makeTreasuresVisibleButtonActionPerformed
예제 #3
0
  private void discardTreasuresButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_discardTreasuresButtonActionPerformed

    // Eliminación de tesoros.
    ArrayList<Treasure> selHidden = getSelectedTreasures(hiddenTreasuresPanel);
    ArrayList<Treasure> selVisible = getSelectedTreasures(visibleTreasuresPanel);

    for (Treasure treasure : selHidden) {
      napakalakiModel.discardHiddenTreasure(treasure);
    }

    for (Treasure treasure : selVisible) {
      napakalakiModel.discardVisibleTreasure(treasure);
    }

    setPlayer(napakalakiModel.getCurrentPlayer());

    // Si el mal rollo es vacío, activamos el botón de equipar tesoros.
    if (playerModel.validState()) {
      this.enableMakeVisible();
    }

    repaint();
  } // GEN-LAST:event_discardTreasuresButtonActionPerformed