Пример #1
0
 public void AIbids()
 {
     Thread.Sleep(500);
     AIplayer.OrderBy(f => f.Face);
     aiBid = AIplayer.ElementAt(0);
     Swap.Add(AIplayer[0]);
     AIplayer.RemoveAt(0);
     Console.WriteLine($"\nAI bids a card: {aiBid.ShowCard()}");
 }
Пример #2
0
 public void ShowTrump()
 {
     Swap.Add(ShuffledDeck[0]);
     ShuffledDeck.RemoveAt(0);
     ShuffledDeck.AddRange(Swap);
     Swap.Clear();
     trump = ShuffledDeck[ShuffledDeck.Count - 1];
     Console.WriteLine($"\n{trump.Suit} are trumps for this game.");
 }
Пример #3
0
 public void AIdefence()
 {
     Thread.Sleep(500);
     aiBid = AIplayer.FirstOrDefault(c => (c.Face > playerBid.Face && c.Suit == playerBid.Suit) ||
                                     (c.Face <= playerBid.Face && c.Suit == trump.Suit) ||
                                     (c.Face > playerBid.Face && c.Suit == trump.Suit) ||
                                     (c.Face <= playerBid.Face && c.Suit != trump.Suit));
     Console.WriteLine($"\nAI bids a card back: {aiBid.ShowCard()}");
     Swap.Add(aiBid);
     AIplayer.Remove(aiBid);
 }
Пример #4
0
 public void MakingBid()
 {
     int.TryParse(Console.ReadLine(), out int PlChoice); //not good if enter not numbers & more than hand has
     if ((PlChoice <= Player.Count) && (PlChoice > 0))
     {
         playerBid = Player.ElementAt(PlChoice);
         Swap.Add(playerBid);
         Console.WriteLine($"\nYour card is {playerBid.ShowCard()}");
         Player.RemoveAt(PlChoice);
     }
     else
     {
         Console.WriteLine("You should chose a card from hand by its number");
         MakingBid();
     }
 }