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()}"); }
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."); }
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); }
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(); } }