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


C# Hand.Draw方法代码示例

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


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

示例1: CanHandDrawCard

        public void CanHandDrawCard()
        {
            var card = new Card(CardValue.Ace, CardSuit.Spades);
            var hand = new Hand();

            hand.Draw(card);

            hand.Cards.First().Should().Be(card);
        }
开发者ID:EdCharbeneau,项目名称:CsharpPoker,代码行数:9,代码来源:CardTests.cs

示例2: CanScoreFullHouse

        public void CanScoreFullHouse()
        {
            var hand = new Hand();

            new List<Card>
                {
                    new Card(CardValue.Ace, CardSuit.Diamonds),
                    new Card(CardValue.Ace, CardSuit.Clubs),
                    new Card(CardValue.Ace, CardSuit.Spades),
                    new Card(CardValue.Two, CardSuit.Hearts),
                    new Card(CardValue.Two, CardSuit.Spades)
                }
            .ForEach(card => hand.Draw(card));

            var scorer = new HandScorer(hand, new FiveCardPokerRanks().HandRanks);

            scorer.GetScore().Name.Should().Be("Full house");
        }
开发者ID:EdCharbeneau,项目名称:CsharpPoker,代码行数:18,代码来源:CardTests.FiveCardPokerTests.cs

示例3: CanScoreFlush

        public void CanScoreFlush()
        {
            var hand = new Hand();

            new List<Card>
                {
                    new Card(CardValue.Ace, CardSuit.Spades),
                    new Card(CardValue.Six, CardSuit.Spades),
                    new Card(CardValue.Ten, CardSuit.Spades),
                    new Card(CardValue.Two, CardSuit.Spades),
                    new Card(CardValue.Two, CardSuit.Spades)
                }
            .ForEach(card => hand.Draw(card));

            var scorer = new HandScorer(hand, new FiveCardPokerRanks().HandRanks);

            scorer.GetScore().Name.Should().Be("Flush");
        }
开发者ID:EdCharbeneau,项目名称:CsharpPoker,代码行数:18,代码来源:CardTests.FiveCardPokerTests.cs

示例4: Turn

 private void Turn(Player Player, Hand Hand, bool Master= false)
 {
     //Console.WriteLine (Player);
     Card C = Player.MakePlay(_DownCard, Hand);
     if (C == null)
     {
         Hand.Draw(_Deck);
         CheckDeck();
         return;
     }
     bool Valid = (Master ? true : _Master.ValidatePlay(_DownCard, C, Player));
     foreach (Player L in _Learners) L.VerifyPlay(_DownCard, C, Valid);
     if (Valid)
     {
         Hand.Play(C, _Return);
         _DownCard = C;
     }
     else
     {
         Hand.Draw(_Deck);
         CheckDeck();
     }
 }
开发者ID:lawrencewade,项目名称:cs440,代码行数:23,代码来源:Game.cs

示例5: CanScorePair

        public void CanScorePair()
        {
            var hand = new Hand();

            new List<Card>
                {
                    new Card(CardValue.Ace, CardSuit.Diamonds),
                    new Card(CardValue.Eight, CardSuit.Spades),
                    new Card(CardValue.Queen, CardSuit.Spades),
                    new Card(CardValue.Six, CardSuit.Spades),
                    new Card(CardValue.Queen, CardSuit.Clubs)
                }
            .ForEach(card => hand.Draw(card));

            var scorer = new HandScorer(hand, new FiveCardPokerRanks().HandRanks);

            scorer.GetScore().Name.Should().Be("Pair");
        }
开发者ID:EdCharbeneau,项目名称:CsharpPoker,代码行数:18,代码来源:CardTests.FiveCardPokerTests.cs

示例6: CanScoreStraightFlush

        public void CanScoreStraightFlush()
        {
            var hand = new Hand();

            new List<Card>
                {
                    new Card(CardValue.Two, CardSuit.Diamonds),
                    new Card(CardValue.Four, CardSuit.Diamonds),
                    new Card(CardValue.Three, CardSuit.Diamonds),
                    new Card(CardValue.Five, CardSuit.Diamonds),
                    new Card(CardValue.Six, CardSuit.Diamonds)
                }
            .ForEach(card => hand.Draw(card));

            var scorer = new HandScorer(hand, new FiveCardPokerRanks().HandRanks);

            scorer.GetScore().Name.Should().Be("Straight flush");
        }
开发者ID:EdCharbeneau,项目名称:CsharpPoker,代码行数:18,代码来源:CardTests.FiveCardPokerTests.cs


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