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
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
public static void main(String[] args) { Napakalaki game = Napakalaki.getInstance(); GameTester test = GameTester.getInstance(); // Poner el numero de jugadores con el que se quiera probar test.play(game, 2); }
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