Пример #1
0
 /// <summary>
 /// These cards will be removed from player's Hand (playable cards), and not their local deck (earned cards). If any card does not exist, this will return false and
 /// no changes will be made.
 /// </summary>
 public bool RemoveCardsFromLocalDeck(List <byte> cardsToRemove)
 {
     try {
         LocalDeck.RemoveCards(cardsToRemove);
     } catch (CardNotPresentException cnp) {
         if (PlayerNo == Players.One)
         {
             cnp.Location = CardLocations.PlayerOneLocalDeck;
         }
         else
         {
             cnp.Location = CardLocations.PlayerTwoLocalDeck;
         }
     }
     return(true);
 }
Пример #2
0
        /// <summary>
        /// Returns true if player has card in local deck.
        /// </summary>
        public bool HasCardInLocalDeck(byte card)
        {
            if (!IsACard(card))
            {
                return(false);
            }
            var deck = LocalDeck.GetDeck();

            foreach (byte cardf in deck)
            {
                if (cardf == card)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #3
0
 /// <summary>
 /// These cards will enter the player's Local Deck (earned cards), and not their Hand (playable cards).
 /// </summary>
 /// <param name="newCards">Cards received directly from Deck. Must be limited to max number of cards available in Hand at once.</param>
 public bool AddCardsToLocalDeck(List <byte> cards)
 {
     LocalDeck.AddCardsToTop(cards);
     return(true);
 }