Ejemplo n.º 1
0
 public Card[] EmptyHand()
 {
     var cardsInHand = new Card[Hand.Count];
     Hand.CopyTo(cardsInHand);
     Hand.Clear();
     return cardsInHand;
 }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 public void ReceiveCard(Card card)
 {
     Hand.Add(card);
 }
Ejemplo n.º 5
0
 public void PutCard(Card card)
 {
     CardsOnTable.Add(card);
 }
Ejemplo n.º 6
0
 public void PlayerPlaysCard(Card card)
 {
     _tableDeck.PutCard(card);
 }