Package mage.cards.decks

Examples of mage.cards.decks.Deck


      } catch (IOException ex) {  }
    }
  }//GEN-LAST:event_btnSaveActionPerformed

  private void btnNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNewActionPerformed
    deck = new Deck();
    refreshDeck();
  }//GEN-LAST:event_btnNewActionPerformed
View Full Code Here


    return selectedColors;
  }

  protected static void buildDeck() {
    deck = new Deck();
    List<ColoredManaSymbol> allowedColors = new ArrayList<ColoredManaSymbol>();
    selectedColors = selectedColors.toUpperCase();
    for (int i = 0; i < selectedColors.length(); i++) {
      char c = selectedColors.charAt(i);
      allowedColors.add(ColoredManaSymbol.lookup(c));
View Full Code Here

     *
     * @return
     */
    private DeckCardLists createDeck() {
        DeckCardLists deckList = new DeckCardLists();
        Deck deck = generateRandomDeck();
        for (Card card : deck.getCards()) {
            CardInfo cardInfo = CardRepository.instance.findCard(card.getExpansionSetCode(), card.getCardNumber());
            if (cardInfo != null) {
                deckList.getCards().add(new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode()));
            }
        }
View Full Code Here

        nextStep();
    }

    protected void openBoosters() {
        for (TournamentPlayer player: this.players.values()) {
            player.setDeck(new Deck());
            if (options.getLimitedOptions().getDraftCube() != null) {
                DraftCube cube = options.getLimitedOptions().getDraftCube();
                for (int i = 0; i < options.getLimitedOptions().getNumberBoosters(); i++) {
                    player.getDeck().getSideboard().addAll(cube.createBooster());
                }
View Full Code Here

    protected boolean joined = false;

    public DraftPlayer(Player player) {
        id = UUID.randomUUID();
        this.player = player;
        this.deck = new Deck();
    }
View Full Code Here

    }
    Seat seat = table.getNextAvailableSeat();
    if (seat == null) {
      throw new GameException("No available seats.");
    }
    Deck deck = Deck.load(deckList);
    if (!Main.server.isTestMode() && !validDeck(deck)) {
      throw new GameException(name + " has an invalid deck for this format");
    }
   
    Player player = createPlayer(name, deck, seat.getPlayerType());
    game.loadCards(deck.getCards(), player.getId());
    game.loadCards(deck.getSideboard(), player.getId());
    table.joinTable(player, seat);
    logger.info("player joined " + player.getId());
    //only add human players to sessionPlayerMap
    if (seat.getPlayer().isHuman()) {
      sessionPlayerMap.put(sessionId, player.getId());
View Full Code Here

  private void leave(UUID sessionId) {
    game.quit(getPlayerId(sessionId));
  }

  public void cheat(UUID sessionId, UUID playerId, DeckCardLists deckList) {
    Deck deck;
    try {
      deck = Deck.load(deckList);
      game.loadCards(deck.getCards(), playerId);
      for (Card card: deck.getCards()) {
        card.putOntoBattlefield(game, Zone.OUTSIDE, null, playerId);
      }
    } catch (GameException ex) {
      logger.warning(ex.getMessage());
    }
View Full Code Here

        }
    }
   

    public void cheat(UUID userId, UUID playerId, DeckCardLists deckList) {
        Deck deck;
        try {
            deck = Deck.load(deckList, false, false);
            game.loadCards(deck.getCards(), playerId);
            for (Card card: deck.getCards()) {
                card.putOntoBattlefield(game, Zone.OUTSIDE, null, playerId);
            }
        } catch (GameException ex) {
            logger.warn(ex.getMessage());
        }
View Full Code Here

        }
        if (userPlayerMap.containsKey(userId) && playerType.equals("Human")){
            user.showUserMessage("Join Table", new StringBuilder("You can join a table only one time.").toString());
            return false;
        }
        Deck deck = null;
        if (!table.getTournament().getTournamentType().isLimited()) {
            if  (deckList != null) {
                deck = Deck.load(deckList, false, false);
            } else {
                user.showUserMessage("Join Table", "No valid deck selected!");
View Full Code Here

        Seat seat = table.getNextAvailableSeat(playerType);
        if (seat == null) {
            user.showUserMessage("Join Table", "No available seats.");
            return false;
        }
        Deck deck = Deck.load(deckList, false, false);

        if (!Main.isTestMode() && !table.getValidator().validate(deck)) {
            StringBuilder sb = new StringBuilder("You (").append(name).append(") have an invalid deck for the selected ").append(table.getValidator().getName()).append(" Format. \n\n");
            for (Map.Entry<String, String> entry : table.getValidator().getInvalid().entrySet()) {
                sb.append(entry.getKey()).append(": ").append(entry.getValue()).append("\n");
View Full Code Here

TOP

Related Classes of mage.cards.decks.Deck

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.