示例#1
0
 public void DiscardCard(int discarded)
 {
     try
     {
         if (CurrentRound != null)
         {
             var cardInd = CurrentRound.CardsInHand.FindIndex(c => c.CardId == discarded);
             if (cardInd >= 0)
             {
                 var card = CurrentRound.CardsInHand[cardInd];
                 DiscardedCards.Add(card);
                 CurrentRound.CardsInHand.RemoveAt(cardInd);
             }
             if (CurrentRound.CardsInHand.Count == 2)
             {
                 CurrentRound.RoundState = RoundState.ChancellorDiscard;
             }
             else if (CurrentRound.CardsInHand.Count == 1)
             {
                 var card = CurrentRound.CardsInHand[0];
                 CardsOnBoard.Add(card);
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("DiscardCard.ex: " + ex.Message);
     }
 }
示例#2
0
 public void Discard(List <Card> cards)
 {
     foreach (Card card in cards)
     {
         DiscardedCards.Add(card);
         DeckOfCards.Remove(card);
     }
 }
示例#3
0
 public void Discard(Card card)
 {
     DiscardedCards.Add(card);
     DeckOfCards.Remove(card);
 }