예제 #1
0
        public void MakeGoodOne()
        {
            var board      = new Board();
            var hands      = board.Hands;
            var myHand     = hands[Seat.South];
            var otherHands = hands.OtherHands(Seat.South);

            new Deck()
            .Shuffle()
            .Deal(hands);
            var fact = new Balanced();

            Assert.IsTrue(fact.MakeGood(myHand, otherHands));
            Console.WriteLine(board);
            Assert.AreEqual(true, BalancedEvaluator.IsBalanced(myHand));
        }
예제 #2
0
        public void HandEvaluation()
        {
            var hand = new Hand();

            hand.Add(Card.Parse("KC"));
            hand.Add(Card.Parse("AC"));
            hand.Add(Card.Parse("6C"));
            hand.Add(Card.Parse("2H"));
            hand.Add(Card.Parse("3H"));
            hand.Add(Card.Parse("QD"));
            hand.Add(Card.Parse("AD"));
            hand.Add(Card.Parse("2S"));
            hand.Add(Card.Parse("3S"));

            var facts = new BalancedEvaluator().Evaluate(hand);

            Assert.AreEqual(1, facts.Count);
            Assert.AreEqual(new Balanced(), facts[0]);
        }
예제 #3
0
 public bool IsTrue(Hand hand)
 {
     return(BalancedEvaluator.IsBalanced(hand));
 }