예제 #1
0
    public void AddCardIntoCardSelectWindow(CardInfo_Base cardInfo)
    {
        CardSelectWindowCardContainer newCardContainer = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.CardSelectWindowCardContainer].AllocateGameObject <CardSelectWindowCardContainer>(AllCardsContainer);

        newCardContainer.Initialize(cardInfo);
        RefreshCardInSelectWindow(newCardContainer, false);
        AllCards.Add(cardInfo.CardID, newCardContainer.M_ChildCard);
        AllCardContainers.Add(cardInfo.CardID, newCardContainer);
    }
예제 #2
0
 /// <summary>
 /// Default constructor to populate the deck
 /// </summary>
 public Deck()
 {
     foreach (string suit in Card.suitNames)
     {
         for (int i = 1; i <= 13; i++)
         {
             Card card = new Card(i, suit);
             AllCards.Add(card);
         }
     }
     _numberOfCards = AllCards.Count;
 }
예제 #3
0
        public void CalculateCardSet()
        {
            Dictionary <Card, int> cardCounter = new Dictionary <Card, int>();

            foreach (Deck d in AllDecks)
            {
                foreach (Card c in d.ClassCards)
                {
                    var foundCard = AllCards.Where(card => card.HearthstoneCard.Name == c.Name).FirstOrDefault();
                    if (foundCard == null)
                    {
                        foundCard = new CardReport()
                        {
                            HearthstoneCard = c
                        };
                        AllCards.Add(foundCard);
                    }

                    foreach (var cardReport in AllCards.Where(w => w.HearthstoneCard.Name == c.Name))
                    {
                        cardReport.CardCount++;
                        cardReport.DecksWithCard.Add(d);
                    }
                }

                foreach (Card c in d.NeutralCards)
                {
                    var foundCard = AllCards.Where(card => card.HearthstoneCard.Name == c.Name).FirstOrDefault();
                    if (foundCard == null)
                    {
                        foundCard = new CardReport()
                        {
                            HearthstoneCard = c
                        };
                        AllCards.Add(foundCard);
                    }

                    foreach (var cardReport in AllCards.Where(w => w.HearthstoneCard.Name == c.Name))
                    {
                        cardReport.CardCount++;
                        cardReport.DecksWithCard.Add(d);
                    }
                }
            }
        }
예제 #4
0
        public void  Initialize()
        {
            ResetState();

            foreach (var cardData in StartingDeck.Where(c => c != null))
            {
                var card = new Card(cardData, this);

                AllCards.Add(card);
                Deck.Add(card);
            }

            if (StartingCharacter != null)
            {
                var startingCharacter = new Card(StartingCharacter, this, Zones.Characters);
                Characters.Add(startingCharacter);
            }
        }