public Hand(IList<Card> cards, IStateScorer handScorer) { Cards = cards; _handScorer = handScorer; if ((handScorer != null) && (cards != null)) { Value = _handScorer.Score(Cards); } BaseValue = (int)Math.Floor(Value); BaseHand = new HandFinder().FindBestHand(Cards); }
public override void CreateContext() { _handFinder = new HandFinder(); _cards = new List<Card>{new Card(CardFigure.Ace,CardColor.Clubs), new Card(CardFigure.Ace,CardColor.Hearts), new Card(CardFigure.King,CardColor.Clubs), new Card(CardFigure.King,CardColor.Hearts), }; // the other cards don't matter for this test except they have to exist for the hand to be valid. _cards.Add(new Card(CardFigure.Queen, CardColor.Clubs)); }