Package csa.jportal.card

Examples of csa.jportal.card.CardList


       
        return subList.drawRandom(1).getCard(0);       
    }
    Card getBuffyCard(CardList heap)
    {
        CardList subList = new CardList();
        if (jCheckBoxForceCreature.isSelected()) heap = heap.removeTypes("Creature");
        for (int i=0; i<heap.size(); i++)
        {
            Card c = heap.getCard(i);
            if (EAIHelper.isBufCard(c) )
                subList.addCard(c);
            else
            if (EAIHelper.isDeBufCard(c) )
                subList.addCard(c);
        }
        if (subList.size()==0) return null;
       
        return subList.drawRandom(1).getCard(0);       
    }
View Full Code Here


       
        return subList.drawRandom(1).getCard(0);       
    }
    Card getAntiMagicCard(CardList heap)
    {
        CardList subList = new CardList();
        if (jCheckBoxForceCreature.isSelected()) heap = heap.removeTypes("Creature");
        for (int i=0; i<heap.size(); i++)
        {
            Card c = heap.getCard(i);
            if (EAIHelper.isAntiMagicCard(c) )
                subList.addCard(c);
        }
        if (subList.size()==0) return null;
       
        return subList.drawRandom(1).getCard(0);       
    }
View Full Code Here

        return subList.drawRandom(1).getCard(0);       
    }
    Card getCardMagicCard(CardList heap)
    {
        // cards that enable to draw more cards
        CardList subList = new CardList();
        if (jCheckBoxForceCreature.isSelected()) heap = heap.removeTypes("Creature");
        for (int i=0; i<heap.size(); i++)
        {
            Card c = heap.getCard(i);
            if (EAIHelper.isCardMagicCard(c) )
                subList.addCard(c);
        }
        if (subList.size()==0) return null;
       
        return subList.drawRandom(1).getCard(0);       
    }
View Full Code Here

        return subList.drawRandom(1).getCard(0);       
    }
    Card getTrickyCard(CardList heap)
    {
        // every non creature card, that is not included in the above!
        CardList subList = new CardList();
        if (jCheckBoxForceCreature.isSelected()) heap = heap.removeTypes("Creature");
        for (int i=0; i<heap.size(); i++)
        {
            Card c = heap.getCard(i);
            if (c.isCreature()) continue;
            if (EAIHelper.isCardMagicCard(c) ) continue;
            if (EAIHelper.isAntiMagicCard(c) ) continue;
            if (EAIHelper.isBufCard(c) ) continue;
            if (EAIHelper.isDeBufCard(c) ) continue;
            if (EAIHelper.isLandDestroy(c) ) continue;
            if (EAIHelper.isCreatureDamageCard(c) ) continue;
            if (EAIHelper.isPlayerDamageCard(c) ) continue;
            if (EAIHelper.isHealCard(c)) continue;

            subList.addCard(c);
        }
        if (subList.size()==0) return null;
       
        return subList.drawRandom(1).getCard(0);       
    }
View Full Code Here

        String className = jComboBox1.getSelectedItem().toString();
        String poolBaseName = jTextField1.getText()+java.io.File.separator;

        try {
            CardList list;
            String deckName;
            CardDeck deck;
            for (int i = 0; i < PLAYER_COUNT; i++)
            {
                String deckBase = "1.Player";
                if (i==1)
                {
                    deckBase = "2.Player";
                }


                deckName = deckBase + " deck";
                deck = new CardDeck(deckName, className, poolBaseName);
                mDecks[i] = new CardList(deck.getCards());

                deckName = deckBase + " library";
                deck = new CardDeck(deckName, className, poolBaseName);
                mLibrary[i] = new CardList(deck.getCards());

                deckName = deckBase + " hand";
                deck = new CardDeck(deckName, className, poolBaseName);
                mHand[i] = new CardList(deck.getCards());

                deckName = deckBase + " creature";
                deck = new CardDeck(deckName, className, poolBaseName);
                mBattlefield[i] = new CardList(deck.getCards());

                deckName = deckBase + " land";
                deck = new CardDeck(deckName, className, poolBaseName);
                mLand[i] = new CardList(deck.getCards());

                deckName = deckBase + " graveyard";
                deck = new CardDeck(deckName, className, poolBaseName);
                mGraveyard[i] = new CardList(deck.getCards());

                deckName = deckBase + " discarded";
                deck = new CardDeck(deckName, className, poolBaseName);
                mDiscarded[i] = new CardList(deck.getCards());
            }
        }
        catch (Throwable e)
        {
            return;
        }

        CardList list;
        String deckName;
        poolBaseName = jTextField2.getText()+java.io.File.separator;;
        className = jTextField3.getText();
        CardDeck deck;
        for (int i = 0; i < PLAYER_COUNT; i++)
View Full Code Here

            }

            if (quest.getTaskType().equals(Q_HAVE_X_IN_HEAP))
            {
                int count = quest.getCount();
                CardList heap = (new CardHeap(getHeapName(), false)).getCardList();
                if (heap.size()>= count)
                    questDone = true;
            }

            if (quest.getTaskType().equals(Q_HAVE_X_RARE))
            {
                int count = quest.getCount();
                CardList heap = (new CardHeap(getHeapName(), false)).getCardList();
                heap = heap.getSubListByRarity("R");
                if (heap.size()>= count)
                    questDone = true;
            }

            if (quest.getTaskType().equals(Q_DEFEAT_OPPONENT))
            {
View Full Code Here

        if (mClassSetting>0) return;
        if (jComboBoxSet.getSelectedIndex() != -1)
        {
            CardSet cset = new CardSet((String)jComboBoxSet.getSelectedItem());
            set = new CardList(cset.getCards());
        }
        else
            set = new CardList();
        resetCards();

//        cardOffset = 0;
          jTextFieldPage.setText("1");
          jTextFieldPageFocusLost(null);
View Full Code Here

        heap = (new CardHeap(mPlayer.getHeapName(), false)).getCardList();

        if (jComboBoxSet.getSelectedIndex() != -1)
        {
            CardSet cset = new CardSet((String)jComboBoxSet.getSelectedItem());
            set = new CardList(cset.getCards());
        }
        else
            set = new CardList();
        resetCards();
    }//GEN-LAST:event_jButton1ActionPerformed
View Full Code Here


        if (jComboBoxSet.getSelectedIndex() != -1)
        {
            CardSet cset = new CardSet((String)jComboBoxSet.getSelectedItem());
            set = new CardList(cset.getCards());
        }
        else
            set = new CardList();

        resetCards();
        cardOffset = 0;
        setCards();
        setPage();
View Full Code Here

        boolean greenAllowed  = jCheckBoxGreen.isSelected();
        boolean redAllowed  = jCheckBoxRed.isSelected();

        for (int i=0; i < set.size();i++)
        {
            CardList list = new CardList();
            Card card = set.getCard(i);

            String rarity = card.getRarity();
            boolean allowed = true;
            if ((rarity.indexOf("R")) != -1) allowed = rareAllowed;
            if ((rarity.indexOf("U")) != -1) allowed = uncommonAllowed;
            if ((rarity.indexOf("C")) != -1) allowed = commonAllowed;
            if ((rarity.indexOf("L")) != -1) allowed = landAllowed;

            if (allowed)
            {
                if (card.hasColor("W")) allowed = whiteAllowed;
                if (card.hasColor("B")) allowed = blackAllowed;
                if (card.hasColor("U")) allowed = blueAllowed;
                if (card.hasColor("G")) allowed = greenAllowed;
                if (card.hasColor("R")) allowed = redAllowed;
            }

            if (allowed)
            {
                card.setColoredGray(true);
                list.addCard(card);
                ListPosId lpi = new ListPosId(list, i, card.getId() );
                allCardsId.put(card.getId(), lpi);
                allCardsPos.put(i, lpi);
            }
        }
View Full Code Here

TOP

Related Classes of csa.jportal.card.CardList

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.