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(); } } }
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(); }
public void PlayCard(CardViewModel card) { Game.ActivePlayer.PlayCard(card.Card, Game.OpponentPlayer); RaisePropertyChanged("Player1"); RaisePropertyChanged("Player2"); CheckForWinner(); }