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); }
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); }
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); }
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(); }
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; }
public void ReceiveCard(Card card) { Hands.Single(h => h.Active).AddCard(card); }
public void ReceiveCard(Card card) { Hand.AddCard(card); }