Ejemplo n.º 1
0
        //public void PlaceCardInBottomOfDeck(PlayingCard card)
        //{
        //    PlayingCards.Add(card);
        //}

        public PlayingCardDeck()
        {
            for (int a = 0; a < 4; a++)
            {
                for (int b = 1; b <= 13; b++)
                {
                    PlayingCard card = new PlayingCard((CardSuit)a, b);
                    PlayingCards.Add(card);
                }
            }
        }
Ejemplo n.º 2
0
        public PlayingCard GetCardFromDeck()
        {
            if (PlayingCards.Count == 0)
            {
                throw new ArgumentException();
            }

            PlayingCard card = this.PlayingCards[0];

            this.PlayingCards.RemoveAt(0);

            return(card);
        }
        private void PlaceCard(PlayingCard card)
        {
            PlayingCardControl cardControl = new PlayingCardControl(card);

            cardControl.Left = (ClientSize.Width - cardControl.Width) / 2 + currentCardOffset.X;
            cardControl.Top  = 300 + currentCardOffset.Y;
            Controls.Add(cardControl);
            cardControl.BringToFront();

            currentCardOffset.X += cardOffset.X;
            currentCardOffset.Y += cardOffset.Y;

            hand_value_label.Text = "Hand value: " + player.Value.ToString();
        }