public Card[] EmptyHand() { var cardsInHand = new Card[Hand.Count]; Hand.CopyTo(cardsInHand); Hand.Clear(); return cardsInHand; }
private PictureBox createPictureBoxForCard(Card card) { // Create the new picture box PictureBox pictureBox = new PictureBox(); // Set the tag so its card can be easily retrieved pictureBox.Tag = card; // Set some properties pictureBox.Image = card.Image; pictureBox.SizeMode = PictureBoxSizeMode.CenterImage; pictureBox.BackColor = Color.Transparent; // Set the width and hight pictureBox.Height = 80; pictureBox.Width = 50; // Set the default position to the deck pictureBox.Left = 75; pictureBox.Top = 182; // Setup click event handler, to allow users to select cards pictureBox.Click += new EventHandler(card_Click); return pictureBox; }
private void PlayCard(Card playerCard) { _unoGame.PlayerPlaysCard(playerCard); Console.WriteLine(Name + " plays " + playerCard.Color + " " + playerCard.Number+" and now has "+(Hand.Count-1)+" card(s) left"); Hand.Remove(playerCard); if (Hand.Count == 0) _unoGame.WinnerFound(Name); Thread.Sleep(700); }
public void ReceiveCard(Card card) { Hand.Add(card); }
public void PutCard(Card card) { CardsOnTable.Add(card); }
public void PlayerPlaysCard(Card card) { _tableDeck.PutCard(card); }