Package csa.jportal.carddeck

Examples of csa.jportal.carddeck.CardDeck


    }//GEN-LAST:event_jComboBoxStateBlockerActionPerformed

    private void jComboBoxAttackerDecksActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxAttackerDecksActionPerformed
        if (mClassSetting > 0 ) return;
        String gameState = jComboBoxStateAttacker.getSelectedItem().toString();
        CardDeck mCardDeck = new CardDeck(gameState, Match.getDebugMatchPoolBaseName(false));
        String key = jComboBoxAttackerDecks.getSelectedItem().toString();
        CardDeckData mDeckData = mCardDeck.getPool().get(key);
        mAttackerDeck = new CardDeck(mDeckData, Match.getDebugMatchPoolBaseName(false));
        setAttackerDeck();
    }//GEN-LAST:event_jComboBoxAttackerDecksActionPerformed
View Full Code Here


    }//GEN-LAST:event_jComboBoxAttackerDecksActionPerformed

    private void jComboBoxBlockerDecksActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxBlockerDecksActionPerformed
        if (mClassSetting > 0 ) return;
        String gameState = jComboBoxStateBlocker.getSelectedItem().toString();
        CardDeck mCardDeck = new CardDeck(gameState, Match.getDebugMatchPoolBaseName(false));
        String key = jComboBoxBlockerDecks.getSelectedItem().toString();
        CardDeckData mDeckData = mCardDeck.getPool().get(key);
        mBlockerDeck = new CardDeck(mDeckData, Match.getDebugMatchPoolBaseName(false));
        setBlockerDeck();
    }//GEN-LAST:event_jComboBoxBlockerDecksActionPerformed
View Full Code Here

    // End of variables declaration//GEN-END:variables

    Vector<String> getDeckListForName(String name)
    {
        String klasse = name;
        CardDeck cardDeck = new CardDeck(name, Match.getDebugMatchPoolBaseName(false));

        Collection<CardDeckData> colC = cardDeck.getPool().getMapForKlasse(klasse).values();
        Iterator<CardDeckData> iterC = colC.iterator();

        Vector<String> names = new Vector<String>();
        while (iterC.hasNext())
        {
View Full Code Here

        return true;
    }

    public void reloadDeck()
    {
        CardDeck deck = new CardDeck(mBoosterBaseName+"Human_" , "", true);
        playerDeck = deck.getCardList();
        jButton5ActionPerformed(null);
    }
View Full Code Here

            Date today = new Date();
            mBoosterBaseName = "tmp"+File.separator+"booster_" + today.getTime()+"_";
        }

        CardHeap heap;
        CardDeck deck;
        if (mPlayer != null)
        {
            heap = new CardHeap(playerHeap.getCards(), mBoosterBaseName+"Human_Heap");
            heap.save();

            if (!pdeckDone)
            {
                pdeckDone = true;
                deck = new CardDeck(playerHeap, mBoosterBaseName+"Human_", "", mBoosterBaseName+"Human_", true);
                deck.save();
                playerDeck = deck.getCardList();
            }
        }

        if (aiDeckCreationDone) return;
        aiDeckCreationDone = true;
        for (int i = 0; i < mPlayers.size(); i++)
        {
            BoosterPlayer p = mPlayers.elementAt(i);
            p.mDeckBase = mBoosterBaseName;


            heap = new CardHeap(p.heap.getCards(), mBoosterBaseName+"AI"+(i+1)+"_Heap");
            heap.save();

            CardList deckList = p.cplayer.buildBoosterDeck(p.heap);
           
            deck = new CardDeck(deckList, mBoosterBaseName+"AI"+(i+1)+"_", "", mBoosterBaseName+"AI"+(i+1)+"_", true);
            deck.save();
            p.cplayer.setDeck(deck);
            p.cplayer.setBoosterHeap(mBoosterBaseName, i+1);
        }
        if (mPlayer != null)
            jButton2.setEnabled(true);
View Full Code Here

        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++)
        {
            String deckBase = "1.Player";
            if (i==1)
            {
                deckBase = "2.Player";
            }
            deckName = deckBase + " deck";
            list = mDecks[i];
            deck = new CardDeck(list, deckName, className, poolBaseName);
            deck.save();

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

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

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

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

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

            deckName = deckBase + " discarded";
            list = mDiscarded[i];
            deck = new CardDeck(list, deckName, className, poolBaseName);
            deck.save();
        }

        // reinit test defs
         resetCombo();
View Full Code Here

TOP

Related Classes of csa.jportal.carddeck.CardDeck

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.