示例#1
0
        public void a_jack_face_card_should_return_value_10()
        {
            var card = new Card() {Suit = Suit.Club, Rank = 11};

            var value = card.GetValue();

            Assert.AreEqual(10, value);
        }
示例#2
0
        public void a_7_of_diamonds_should_return_value_7()
        {
            var card = new Card() {Suit = Suit.Diamond, Rank = 7};

            var value = card.GetValue();

            Assert.AreEqual(7, value);
        }
示例#3
0
        public void an_ace_should_return_value_1()
        {
            var card = new Card() {Suit = Suit.Club, Rank = 1};

            var value = card.GetValue();

            Assert.AreEqual(1, value);
        }
示例#4
0
文件: Hand.cs 项目: hai5nguy/HaiJack
 public void AddCard(Card card)
 {
     var newCard = card;
     newCard.ImageMargin = string.Format("{0},0,0,0", (Cards.Count == 0) ? "0" : "-50");
     Cards.Add(card);
     UpdateValue();
 }
示例#5
0
        public void SplitHand()
        {
            var activeHand = Hands.Single(h => h.Active);
            var newCard = new Card()
            {
                Hidden = false,
                ImageMargin = "0,0,0,0",
                ImageUri = activeHand.Cards[1].ImageUri,
                Rank = activeHand.Cards[1].Rank,
                Suit = activeHand.Cards[1].Suit,
            };
            var newHand = new Hand()
            {
                Status = HandStatus.Playable
            };
            newHand.AddCard(newCard);

            var activeIndex = Hands.ToList().FindIndex(h => h.Active);
            Hands.Insert(activeIndex + 1, newHand);
            Hands[activeIndex].RemoveCard(1);

            Hands[activeIndex].AddCard(Game.TheShoe.GetCard());
            Hands[activeIndex + 1].AddCard(Game.TheShoe.GetCard());

            SetBetOnHand(Hands[activeIndex + 1].Id, activeHand.CurrentBet);

            SplitAvailable = false;
        }
示例#6
0
 public void ReceiveCard(Card card)
 {
     Hands.Single(h => h.Active).AddCard(card);
 }
示例#7
0
 public void ReceiveCard(Card card)
 {
     Hand.AddCard(card);
 }