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