Package mage.cards.decks

Examples of mage.cards.decks.DeckCardInfo


            }
            int count = Integer.parseInt(m.group(2));
            String setCode = m.group(3);
            int cardNum = Integer.parseInt(m.group(4));

            DeckCardInfo deckCardInfo  = null;
            CardInfo cardInfo = CardRepository.instance.findCard(setCode, cardNum);
            if (cardInfo != null) {
                deckCardInfo = new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode());
            }
            if (deckCardInfo != null) {
                for (int i = 0; i < count; i++) {
                    if (!sideboard) {
                        deckList.getCards().add(deckCardInfo);
View Full Code Here


                if (lastReleasedCard == null) {
                    lastReleasedCard = cards.get(0);
                }
                for (int i = 0; i < num; i++) {
                    if (!sideboard) {
                        deckList.getCards().add(new DeckCardInfo(lastReleasedCard.getName(),lastReleasedCard.getCardNumber(), lastReleasedCard.getSetCode()));
                    } else {
                        deckList.getSideboard().add(new DeckCardInfo(lastReleasedCard.getName(),lastReleasedCard.getCardNumber(), lastReleasedCard.getSetCode()));
                    }
                }
            }
        } catch (NumberFormatException nfe) {
            sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
View Full Code Here

            } else {
                Random random = new Random();
                for (int i = 0; i < num; i++) {
                    CardInfo cardInfo = cards.get(random.nextInt(cards.size()));
                    if (!sideboard) {
                        deckList.getCards().add(new DeckCardInfo(cardInfo.getName(),cardInfo.getCardNumber(), cardInfo.getSetCode()));
                    } else {
                        deckList.getSideboard().add(new DeckCardInfo(cardInfo.getName(),cardInfo.getCardNumber(), cardInfo.getSetCode()));
                    }
                }
            }
        } catch (NumberFormatException nfe) {
            sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
View Full Code Here

            } else {
                Random random = new Random();
                for (int i = 0; i < num; i++) {
                    CardInfo cardInfo = cards.get(random.nextInt(cards.size()));
                    if (!sideboard) {
                        deckList.getCards().add(new DeckCardInfo(cardInfo.getName(),cardInfo.getCardNumber(), cardInfo.getSetCode()));
                    } else {
                        deckList.getSideboard().add(new DeckCardInfo(cardInfo.getName(),cardInfo.getCardNumber(), cardInfo.getSetCode()));
                    }
                }
            }
        } catch (NumberFormatException nfe) {
            sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
View Full Code Here

        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()));
            }
        }
        return deckList;
    }
View Full Code Here

TOP

Related Classes of mage.cards.decks.DeckCardInfo

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.