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


C# Hand.FindAvailableCardsCombinations方法代码示例

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


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

示例1: FourNines

        public void FourNines()
        {
            var hand = new Hand
                           {
                               new Card().Nine().OfClubs(),
                               new Card().Nine().OfDiamonds(),
                               new Card().Nine().OfHearts(),
                               new Card().Nine().OfSpades(),

                               new Card().Seven().OfSpades(),
                               new Card().Ace().OfDiamonds(),
                               new Card().King().OfHearts(),
                               new Card().Eight().OfSpades(),
                           };

            var combinations = hand.FindAvailableCardsCombinations().ToList();

            Assert.AreEqual(1, combinations.Count);
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.FourOfNines, CardType.Nine)));
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:20,代码来源:HandTests_FindAvailableCardsCombinations.cs

示例2: FourOfAKindAndQuart

        public void FourOfAKindAndQuart()
        {
            var hand = new Hand
                           {
                               new Card().King().OfClubs(),
                               new Card().King().OfDiamonds(),
                               new Card().Queen().OfDiamonds(),
                               new Card().Jack().OfDiamonds(),
                               new Card().Ten().OfDiamonds(),
                               new Card().Nine().OfDiamonds(),
                               new Card().King().OfHearts(),
                               new Card().King().OfSpades(),
                           };

            var combinations = hand.FindAvailableCardsCombinations().ToList();

            Assert.AreEqual(2, combinations.Count);
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.FourOfAKind, CardType.King)));
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.Quart, CardType.Queen, CardSuit.Diamonds)));
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:20,代码来源:HandTests_FindAvailableCardsCombinations.cs

示例3: TwoTiercesFromTheSameSuit

        public void TwoTiercesFromTheSameSuit()
        {
            var hand = new Hand
                           {
                               new Card().Eight().OfSpades(),
                               new Card().Nine().OfSpades(),
                               new Card().Ten().OfSpades(),
                               new Card().Ten().OfHearts(),
                               new Card().Nine().OfClubs(),
                               new Card().Queen().OfSpades(),
                               new Card().King().OfSpades(),
                               new Card().Ace().OfSpades(),
                           };

            var combinations = hand.FindAvailableCardsCombinations().ToList();

            Assert.AreEqual(2, combinations.Count);
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.Tierce, CardType.Ace, CardSuit.Spades)));
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.Tierce, CardType.Ten, CardSuit.Spades)));
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:20,代码来源:HandTests_FindAvailableCardsCombinations.cs

示例4: TwoQuartsFromDifferentSuits

        public void TwoQuartsFromDifferentSuits()
        {
            var hand = new Hand
                           {
                               new Card().Seven().OfClubs(),
                               new Card().Eight().OfClubs(),
                               new Card().Eight().OfSpades(),
                               new Card().Nine().OfSpades(),
                               new Card().Nine().OfClubs(),
                               new Card().Ten().OfClubs(),
                               new Card().Ten().OfSpades(),
                               new Card().Jack().OfSpades(),
                           };

            var combinations = hand.FindAvailableCardsCombinations().ToList();

            Assert.AreEqual(2, combinations.Count);
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.Quart, CardType.Ten, CardSuit.Clubs)));
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.Quart, CardType.Jack, CardSuit.Spades)));
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:20,代码来源:HandTests_FindAvailableCardsCombinations.cs

示例5: QuintFromSevenToAce

        public void QuintFromSevenToAce()
        {
            var hand = new Hand
                           {
                               new Card().Eight().OfSpades(),
                               new Card().King().OfSpades(),
                               new Card().Jack().OfSpades(),
                               new Card().Ace().OfSpades(),
                               new Card().Seven().OfSpades(),
                               new Card().Queen().OfSpades(),
                               new Card().Ten().OfSpades(),
                               new Card().Nine().OfSpades(),
                           };

            var combinations = hand.FindAvailableCardsCombinations().ToList();

            Assert.AreEqual(1, combinations.Count);
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.Quint, CardType.Ace, CardSuit.Spades)));
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:19,代码来源:HandTests_FindAvailableCardsCombinations.cs

示例6: QuartFromJackToAce

        public void QuartFromJackToAce()
        {
            var hand = new Hand
                           {
                               new Card().Ace().OfSpades(),
                               new Card().Ace().OfClubs(),
                               new Card().Seven().OfClubs(),
                               new Card().King().OfHearts(),

                               new Card().Jack().OfDiamonds(),
                               new Card().Queen().OfDiamonds(),
                               new Card().Ace().OfDiamonds(),
                               new Card().King().OfDiamonds(),
                           };

            var combinations = hand.FindAvailableCardsCombinations().ToList();

            Assert.AreEqual(1, combinations.Count);
            Assert.IsTrue(combinations.Contains(new CardsCombination(CardsCombinationType.Quart, CardType.Ace, CardSuit.Diamonds)));
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:20,代码来源:HandTests_FindAvailableCardsCombinations.cs

示例7: NoCombinationsAvailable

        public void NoCombinationsAvailable()
        {
            var hand = new Hand
                           {
                               new Card().Seven().OfClubs(),
                               new Card().Eight().OfClubs(),
                               new Card().Nine().OfSpades(),
                               new Card().Ten().OfSpades(),
                               new Card().Ten().OfClubs(),
                               new Card().Ten().OfHearts(),
                               new Card().Jack().OfDiamonds(),
                               new Card().Ace().OfClubs(),
                           };

            var combinations = hand.FindAvailableCardsCombinations().ToList();

            Assert.AreEqual(0, combinations.Count);
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:18,代码来源:HandTests_FindAvailableCardsCombinations.cs


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