상속: BaseViewModel
예제 #1
0
 public async Task PlayCardAsync()
 {
     
     if (IsAI)
     {
         Console.WriteLine("IA thinking");
         var card = await Player.DetermineNextMoveAsync(GameVM.Game.OpponentPlayer);
         if (card != null)
         {
             var selectedCard = HandVM.ToList().FirstOrDefault(c => c.Card.Equals(card));
             if (selectedCard != null)
             {
                 SelectedCard = selectedCard;
             }
             //Thread.Sleep(500);
             await PlayCardAsync();
         }
          
     }
 }
예제 #2
0
 public void PlayCard(CardViewModel card)
 {
     if (IsActive)
     {
         GameVM.PlayCard(card);
         Action = card.Action == Core.Action.HEAL ? "+" + card.Value : "-" + card.Value;
         Console.WriteLine(@"'" + Player.Name + @"' played " + card.Action + @" " + card.Value);
     }
     InitHand();
 }
예제 #3
0
        public void PlayCard(CardViewModel card)
        {
            Game.ActivePlayer.PlayCard(card.Card, Game.OpponentPlayer);

            RaisePropertyChanged("Player1");
            RaisePropertyChanged("Player2");
            CheckForWinner();
        }