Example #1
0
        public void SplitHand(PlayerHandControl sourceHandControl)
        {
            //take a card from the source hand
            Card cardToMoveToNewHand = sourceHandControl.TakeLastCard();
            //create a new hand for the active player
            PlayerHand newHand = controller.AddHandToPlayer(controller.ActivePlayer, State.NotYetPlayed);

            newHand.State = State.NotYetPlayed;


            //add the card that was removed from the source to the new hand
            var newPlayerHandControl = new PlayerHandControl(newHand, controller, this);

            controller.GivePlayerACard(newHand, cardToMoveToNewHand);
            newPlayerHandControl.Visible = true;
            playerHandControlList.Add(newPlayerHandControl);
            layout.Controls.Add(newPlayerHandControl);


            controller.IncreaseBet(newHand, double.Parse(tbBet.Text));



            newPlayerHandControl.DeactivateButtons();

            controller.GivePlayerNextCardInShoe(controller.ActivePlayer.ActiveHand, true);

            controller.GivePlayerNextCardInShoe(newHand, true);
        }