Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
0
  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);
  }
Ejemplo n.º 4
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