Ejemplo n.º 1
0
    public void FillDeck(EnemyDifficulty difficulty)
    {
        ShowCardIndicators();

        switch (difficulty)
        {
        case EnemyDifficulty.Beginner:
            // set up the cards to be played
            // for beginner battle there will be 5 copies of each 1-9 card
            Card[] addCardsBgn = new Card[45];
            for (int i = 0; i < additionCardsPrefabs.Length; i++)
            {
                ArrayFuncs.FillArray(addCardsBgn, additionCardsPrefabs[i], (i * 5), 5);
            }

            // move the cards to the deck
            deckCards.InsertRange(0, addCardsBgn);
            break;

        case EnemyDifficulty.Intermediate:
            // set up the cards to be played
            // for intermediate battle there will be 16 copies of each 1-9 card
            Card[] addCardsInt = new Card[144];
            for (int i = 0; i < additionCardsPrefabs.Length; i++)
            {
                ArrayFuncs.FillArray(addCardsInt, additionCardsPrefabs[i], (i * 16), 16);
            }

            // intermediate battle will include 8 wild cards    *** wild cards are assumed to be single card type ***
            Card[] wildCardInt = new Card[8];
            for (int j = 0; j < wildCardsPrefabs.Length; j++)
            {
                ArrayFuncs.FillArray(wildCardInt, wildCardsPrefabs[j], 0, 8);
            }

            // move the cards to the deck
            deckCards.InsertRange(0, addCardsInt);
            deckCards.InsertRange(addCardsInt.Length, wildCardInt);
            break;

        case EnemyDifficulty.Expert:
            // currently expert is same as intermediate mode
            goto case EnemyDifficulty.Intermediate;
        }
    }