Beispiel #1
0
        private void Stock_Click(object sender, EventArgs e)
        {
            try
            {
                if (game.Turn != player1)
                {
                    MessageBox.Show("Please wait for your turn before drawing a card.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                Card aCard;
                aCard = aDeck.DrawOneCard();
                UpdateStockCount();

                player1.PlayHand.AddCard(aCard);
                player1.PlayHand.Sort();
                ShowHandFront(player1.CardsPanel, player1.PlayHand);

                groupCards = new List <Card>();

                //Enables drop and dump
                //Player 1 can't drop or dump until card is drawn from stock
                PanelHandP1.Enabled = true;
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }