当前位置: 首页>>代码示例>>C#>>正文


C# PokerHandsChecker.CheckHand方法代码示例

本文整理汇总了C#中Poker.PokerHandsChecker.CheckHand方法的典型用法代码示例。如果您正苦于以下问题:C# PokerHandsChecker.CheckHand方法的具体用法?C# PokerHandsChecker.CheckHand怎么用?C# PokerHandsChecker.CheckHand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Poker.PokerHandsChecker的用法示例。


在下文中一共展示了PokerHandsChecker.CheckHand方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestForCompareEqual

        public void TestForCompareEqual()
        {
            IHand straightHand1 = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Seven, CardSuit.Spades),
                new Card(CardFace.Eight, CardSuit.Clubs),
                new Card(CardFace.Five, CardSuit.Hearts),
                new Card(CardFace.Four, CardSuit.Diamonds),
            });

            IHand straightHand = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Seven, CardSuit.Spades),
                new Card(CardFace.Eight, CardSuit.Clubs),
                new Card(CardFace.Five, CardSuit.Hearts),
                new Card(CardFace.Four, CardSuit.Diamonds),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(straightHand);
            checker.CheckHand(straightHand1);
            Assert.AreEqual(0, checker.CompareHands(straightHand, straightHand1));
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:23,代码来源:HandsTester.cs

示例2: TestForCompareGreater

        public void TestForCompareGreater()
        {
            IHand highCardHand = new Hand(new List<ICard>() {
                new Card(CardFace.Ace, CardSuit.Clubs),
                new Card(CardFace.Two, CardSuit.Hearts),
                new Card(CardFace.Jack, CardSuit.Clubs),
                new Card(CardFace.Three, CardSuit.Hearts),
                new Card(CardFace.Five, CardSuit.Diamonds),
            });

            IHand straightHand = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Seven, CardSuit.Spades),
                new Card(CardFace.Eight, CardSuit.Clubs),
                new Card(CardFace.Five, CardSuit.Hearts),
                new Card(CardFace.Four, CardSuit.Diamonds),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(straightHand);
            checker.CheckHand(highCardHand);
            Assert.AreEqual(1, checker.CompareHands(straightHand, highCardHand));
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:23,代码来源:HandsTester.cs

示例3: StraightFlush

        public void StraightFlush()
        {
            IHand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Seven, CardSuit.Clubs),
                new Card(CardFace.Four, CardSuit.Clubs),
                new Card(CardFace.Five, CardSuit.Clubs),
                new Card(CardFace.Eight, CardSuit.Clubs),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(hand);
            Assert.AreEqual(HandStrength.StraightFlush, hand.Power);
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:14,代码来源:HandsTester.cs

示例4: Main

        static void Main()
        {
            IHand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Spades),
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Four, CardSuit.Hearts),
                new Card(CardFace.Four, CardSuit.Diamonds),
                new Card(CardFace.Two, CardSuit.Clubs),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(hand);
            Console.WriteLine(hand.Power);
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:14,代码来源:PokerExample.cs

示例5: TestThreeOfAKind

        public void TestThreeOfAKind()
        {
            IHand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Hearts),
                new Card(CardFace.Six, CardSuit.Diamonds),
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Three, CardSuit.Clubs),
                new Card(CardFace.Two, CardSuit.Clubs),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(hand);
            Assert.AreEqual(HandStrength.ThreeOfAKind, hand.Power);
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:14,代码来源:HandsTester.cs

示例6: TestForTwoSameFaces

        public void TestForTwoSameFaces()
        {
            IHand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Four, CardSuit.Clubs),
                new Card(CardFace.Three, CardSuit.Clubs),
                new Card(CardFace.Two, CardSuit.Clubs),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(hand);
            Assert.AreEqual(false, hand.IsValid);
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:14,代码来源:HandsTester.cs

示例7: TestForRoyal

        public void TestForRoyal()
        {
            IHand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Ace, CardSuit.Clubs),
                new Card(CardFace.King, CardSuit.Clubs),
                new Card(CardFace.Queen, CardSuit.Clubs),
                new Card(CardFace.Jack, CardSuit.Clubs),
                new Card(CardFace.Ten, CardSuit.Clubs),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(hand);
            Assert.AreEqual(HandStrength.RoyalFlush, hand.Power);
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:14,代码来源:HandsTester.cs

示例8: TestForOnePair

        public void TestForOnePair()
        {
            IHand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Six, CardSuit.Hearts),
                new Card(CardFace.Four, CardSuit.Clubs),
                new Card(CardFace.King, CardSuit.Clubs),
                new Card(CardFace.Ace, CardSuit.Clubs),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(hand);
            Assert.AreEqual(HandStrength.OnePair, hand.Power);
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:14,代码来源:HandsTester.cs

示例9: TestForFlush

        public void TestForFlush()
        {
            IHand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Six, CardSuit.Clubs),
                new Card(CardFace.Five, CardSuit.Clubs),
                new Card(CardFace.King, CardSuit.Clubs),
                new Card(CardFace.Jack, CardSuit.Clubs),
                new Card(CardFace.Two, CardSuit.Clubs),
            });

            IPokerHandsChecker checker = new PokerHandsChecker();
            checker.CheckHand(hand);
            Assert.AreEqual(HandStrength.Flush, hand.Power);
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:14,代码来源:HandsTester.cs


注:本文中的Poker.PokerHandsChecker.CheckHand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。