Package mage.cards.repository

Examples of mage.cards.repository.ExpansionInfo


    public static Set<String> getLandSetCodeForDeckSets(Set<String> setCodesDeck) {
       
        Set<String> setCodesland = new HashSet<>();
        // decide from which sets basic lands are taken from
        for (String setCode :setCodesDeck) {
            ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
            if (expansionInfo.hasBasicLands()) {
                setCodesland.add(expansionInfo.getCode());
            }
        }

        // if sets have no basic land, take land from block
        if (setCodesland.isEmpty()) {
            for (String setCode :setCodesDeck) {
                ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
                ExpansionInfo [] blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName());
                for (ExpansionInfo blockSet: blockSets) {
                    if (blockSet.hasBasicLands()) {
                        setCodesland.add(blockSet.getCode());
                    }
                }
View Full Code Here


            } else {
                // search the card released last with this name
                Date lastReleaseDate = new GregorianCalendar(1900, 1, 1).getTime();
                CardInfo lastReleasedCard = null;
                for (CardInfo cardinfo: cards) {
                    ExpansionInfo set = ExpansionRepository.instance.getSetByCode(cardinfo.getSetCode());
                    if (set != null) {
                        if (lastReleaseDate == null || set.getReleaseDate().after(lastReleaseDate)) {
                            lastReleasedCard = cardinfo;
                            lastReleaseDate = set.getReleaseDate();
                        }
                    }
                }
                if (lastReleasedCard == null) {
                    lastReleasedCard = cards.get(0);
View Full Code Here

        List<String> landSets = new LinkedList<String>();

        // decide from which sets basic lands are taken from
        for (String setCode :setsToUse) {
            ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
            if (expansionInfo.hasBasicLands()) {
                landSets.add(expansionInfo.getCode());
            }
        }

        // if sets have no basic land, take land from block
        if (landSets.isEmpty()) {
            for (String setCode :setsToUse) {
                ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
                ExpansionInfo [] blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName());
                for (ExpansionInfo blockSet: blockSets) {
                    if (blockSet.hasBasicLands()) {
                        landSets.add(blockSet.getCode());
                    }
                }
View Full Code Here

    public void showDialog(Deck deck) {
        this.deck = deck;

        // decide from which sets basic lands are taken from
        for (String setCode :deck.getExpansionSetCodes()) {
            ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
            if (expansionInfo.hasBasicLands()) {
                this.setCodesland.add(expansionInfo.getCode());
            }
        }

        // if sets have no basic land, take land from block
        if (this.setCodesland.isEmpty()) {
            for (String setCode :deck.getExpansionSetCodes()) {
                ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
                ExpansionInfo [] blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName());
                for (ExpansionInfo blockSet: blockSets) {
                    if (blockSet.hasBasicLands()) {
                        this.setCodesland.add(blockSet.getCode());
                    }
                }
View Full Code Here

                if (this.packs.size() >= packNumber - 1) {
                    JComboBox comboBox = this.packs.get(packNumber-1);
                    ComboBoxModel model = comboBox.getModel();
                    int size = model.getSize();
                    for(int i=0;i<size;i++) {
                        ExpansionInfo element = (ExpansionInfo) model.getElementAt(i);
                        if (element.getCode().equals(pack.trim())) {
                            comboBox.setSelectedIndex(i);
                            break;
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of mage.cards.repository.ExpansionInfo

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.