예제 #1
0
        private static void HandleCallingAnnounce(PlayerViewModel player, Deck deck)
        {
            var card = player.SelectedCard;

            if (card != null)
            {
                if (SixtySixUtil.HasForty(player.ToPlayer().Cards, card.ToCard(), deck))
                {
                    player.Score   += Constants.FORTY_ANNOUNCEMENT;
                    player.Messages = "Forty!!!";
                }
                else if (SixtySixUtil.HasTwenty(player.ToPlayer().Cards, card.ToCard(), deck))
                {
                    player.Score   += Constants.TWENTY_ANNOUNCEMENT;
                    player.Messages = "Twenty!!!";
                }
            }
        }
예제 #2
0
 private void ChangeTrumpCardLogic(PlayerViewModel player)
 {
     if (SixtySixUtil.CanSwap(CardViewModel.ConvertListOfCardViewModelsToListOFCard(player.Cards), this.Deck))
     {
         var card = player.Cards.FirstOrDefault(x => { return(x.Suit == this.Deck.TrumpSuit && x.Value == CardValue.NINE); });
         if (card != null && player.Cards.Contains(card))
         {
             player.Cards.Add(this.TrumpCard);
             this.Deck.Cards.Remove(this.TrumpCard.ToCard());
             this.TrumpCard = card;
             player.Cards.Remove(card);
             player.Messages = "Change Trump card!!!";
         }
     }
     else
     {
         this.BoardMessage = "Cannot Change The Trump card!!!";
     }
 }