示例#1
0
 public void setTreasure(Treasure tesoro) {
   treasureModel = tesoro;
   this.nombretesoro.setText(treasureModel.getName());
   this.bonustesoro.setText(Integer.toString(treasureModel.getBonus()));
   this.tipotesoro.setText(treasureModel.getType().toString());
   repaint();
 }
示例#2
0
 void setTreasure(Treasure t) {
   treasureModel = t;
   System.out.println("/treasures/" + treasureModel.getName() + ".jpg");
   cardLabel.setIcon(
       new javax.swing.ImageIcon(
           getClass().getResource("/treasures/" + treasureModel.getName() + ".jpg")));
   repaint();
 }
示例#3
0
  private int showTreasures(String message, ArrayList<Treasure> treasures, boolean menu) {
    int optionMenu = Command.GoBack.menu;

    System.out.println("\n------- ------- ------- ------- ------- ------- -------");
    System.out.println(message + "\n");
    if (menu) System.out.println("\n" + Command.GoBack.menu + " : " + Command.GoBack.text);

    for (Treasure t : treasures) {
      optionMenu++;
      System.out.println("\n" + (menu ? optionMenu + ":" : "") + t.toString());
    }
    return optionMenu;
  }
示例#4
0
  public void setTreasure(Treasure t) {
    treasureModel = t;

    String varname = treasureModel.getName();
    name.setText(varname);
    setImage(varname);

    tipo.setText(treasureModel.getType().toString());

    bonmin.setText(Integer.toString(treasureModel.getMinBonus()));
    bonmax.setText(Integer.toString(treasureModel.getMaxBonus()));
    coins.setText(Integer.toString(treasureModel.getGoldCoins()));
    setTitle(varname);
    repaint();
  }
示例#5
0
  private Command processCommand(Command command, Player aPlayer) {
    Treasure aTreasure;

    switch (command) {
      case Exit:
        break;
      case Combat:
        break;
      case ShowMonster:
        System.out.println("\n------- ------- ------- ------- ------- ------- ------- ");
        System.out.println("El monstruo actual es:\n\n" + game.getCurrentMonster().toString());
        break;
      case ShowVisibleTreasure:
        showTreasures("Esta es tu lista de tesoros visibles", aPlayer.getVisibleTreasures(), false);
        break;
      case ShowHiddenTreasure:
        showTreasures("Esta es tu lista de tesoros ocultos", aPlayer.getHiddenTreasures(), false);
        break;
      case MakeTreasureVisible:
        manageMakeTreasureVisible(aPlayer);
        break;
      case DiscardVisibleTreasure:
        manageDiscardTreasures(true, aPlayer);
        break;
      case DiscardHiddenTreasure:
        manageDiscardTreasures(false, aPlayer);
        break;
      case DiscardAll:
        aPlayer.discardAllTreasures();
        break;
      case StealTreasure:
        aTreasure = aPlayer.stealTreasure();
        if (aTreasure == null) System.out.println("\n\n No has podido robar nada \n\n");
        else System.out.println("\n\n Has robado este tesoro: \n\n" + aTreasure.toString());
        break;
      case NextTurn:
        if (!game.nextTurn()) {
          System.out.println("\n\n ERROR \n");
          System.out.println("No cumples las condiciones para pasar de turno.");
          System.out.println("O bien tienes más de 4 tesoros ocultos");
          System.out.println("O bien te queda mal rollo por cumplir");
        } else {
          command = Command.NextTurnAllowed;
        }
        break;
    }
    return command;
  }