public void PopRuku(Coloda coloda) { while (Ruka.Count < 6 && coloda.ColodaCard.Count > 0) { Ruka.Add(coloda.ColodaCard.Last()); coloda.ColodaCard.RemoveAt(coloda.ColodaCard.Count - 1); } }
public TableForm() { InitializeComponent(); Coloda = new Coloda(); trumpCard.Text = "Козырь: " + Coloda.Kozir.ToString(); Player1 = new Player { Name = "Player1" }; Player1.PopRuku(Coloda); AddCardsToPanel(Player1.Ruka, Player1Cards); Player2 = new Player { Name = "Player2" }; Player2.PopRuku(Coloda); AddCardsToPanel(Player2.Ruka, Player2Cards); Table = new Table(); CountOfCards.Text = "Карт в колоде: " + Coloda.ColodaCard.Count; IdentifyFirst(); }