public override int CompareTo(SpecifiedPokerHand other) { if (other is Pair) { Pair otherPair = other as Pair; if (this.HighPairValue != otherPair.HighPairValue) { return(base.CompareSingleCard(this.HighPairValue, otherPair.HighPairValue)); } else { List <Card> theseCards = this.Cards.Where(c => c.Value != this.HighPairValue).ToList(); List <Card> otherCards = other.Cards.Where(c => c.Value != otherPair.HighPairValue).ToList(); theseCards.Sort(new HighAceCardComparer()); otherCards.Sort(new HighAceCardComparer()); return(base.CompareHighToLowCards(theseCards.ToArray(), otherCards.ToArray())); } } else { return(base.CompareTo(other)); } }
public override int CompareTo(SpecifiedPokerHand other) { if (other is TwoPair) { TwoPair otherTwoPair = other as TwoPair; if (this.HighestPairValue != otherTwoPair.HighestPairValue) { return(base.CompareSingleCard(this.HighestPairValue, otherTwoPair.HighestPairValue)); } else if (this.LowestPairValue != otherTwoPair.LowestPairValue) { return(base.CompareSingleCard(this.LowestPairValue, otherTwoPair.LowestPairValue)); } else if (this.FifthCard.Value != otherTwoPair.FifthCard.Value) { return(base.CompareSingleCard(this.FifthCard.Value, otherTwoPair.FifthCard.Value)); } else { return(0); } } else { return(base.CompareTo(other)); } }
public override int CompareTo(SpecifiedPokerHand other) { if (other is Straight) { Straight otherStraight = other as Straight; return(base.CompareSingleCard(this.HighCard, otherStraight.HighCard)); } else { return(base.CompareTo(other)); } }
public override int CompareTo(SpecifiedPokerHand other) { if (other is ThreeOfAKind) { ThreeOfAKind otherThreeOfAKind = other as ThreeOfAKind; return(base.CompareSingleCard(this.HighCardValue, otherThreeOfAKind.HighCardValue)); } else { return(base.CompareTo(other)); } }
public override int CompareTo(SpecifiedPokerHand other) { if (other is FourOfAKind) { FourOfAKind fourOfAKind = other as FourOfAKind; return(base.CompareSingleCard(this.HighCard, fourOfAKind.HighCard)); } else { return(base.CompareTo(other)); } }
public override int CompareTo(SpecifiedPokerHand other) { if (other is FullHouse) { FullHouse otherFullHouse = other as FullHouse; return(base.CompareSingleCard(this.HighCard, otherFullHouse.HighCard)); } else { return(base.CompareTo(other)); } }