Ejemplo n.º 1
0
 //Adds card to hand, returns new total
 public List<Card> Hit(Card card)
 {
     CurrentHand.Add(card);
     if(Hand4 != null)
     {
         Hand4.Add(card);
     }
     playerNotify(card, i);
     return CurrentHand;
 }
Ejemplo n.º 2
0
        public void Split(List<Card> cards)
        {
            //very cludgy probably won't work
            if (i == 1)
            {
                // to check if cards are the same and to handle splitting tens
                if (cards[1].Face == cards[0].Face || ((int)cards[1].Face >= 10 && (int)cards[0].Face >= 10))
                {
                    Hand2.Add(Hand[1]);
                    Hand.RemoveAt(1);
                    CurrentHand = Hand; 
                    i++;
                }
            }

            if (i == 2)
            {
                // to check if cards are the same and to handle splitting tens
                if (cards[1].Face == cards[0].Face || ((int)cards[1].Face >= 10 && (int)cards[0].Face >= 10))
                {
                    Hand3.Add(Hand[1]);
                    Hand2.RemoveAt(1);
                    CurrentHand = Hand2;
                    i++;
                }
            }

            if (i == 3)
            {
                // to check if cards are the same and to handle splitting tens
                if (cards[1].Face == cards[0].Face || ((int)cards[1].Face >= 10 && (int)cards[0].Face >= 10))
                {
                    Hand4.Add(Hand[1]);
                    Hand3.RemoveAt(1);
                    CurrentHand = Hand3;
                    i++;
                }
            }
            
        }