本文整理汇总了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);
}
示例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");
}
示例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");
}
示例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();
}
}
示例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");
}
示例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");
}