public IPokerRule CheckRule(List <Card> cards) { IPokerRule high = null; if (HasOnlyHighCard(cards)) { high = new High() { HighCard = this.HighCard, HighValue = this.HighValue, Name = this.Name, Value = this.Value }; } return(high); }
public IPokerRule CheckRule(List <Card> cards) { IPokerRule threeKind = null; if (HasThreeSameValue(cards)) { threeKind = new ThreeAKind() { HighCard = this.HighCard, HighValue = this.HighValue, Name = this.Name, Value = this.Value }; } return(threeKind); }
public IPokerRule CheckRule(List <Card> cards) { IPokerRule twoPair = null; if (HasTwoPair(cards)) { twoPair = new TwoPair() { HighCard = this.HighCard, HighValue = this.HighValue, Name = this.Name, Value = this.Value }; } return(twoPair); }
public IPokerRule CheckRule(List <Card> cards) { IPokerRule straight = null; if (!HasSameSuit(cards) && AllConsecutiveValue(cards)) { straight = new Straight() { HighCard = this.HighCard, HighValue = this.HighValue, Name = this.Name, Value = this.Value }; } return(straight); }
public IPokerRule CheckRule(List <Card> cards) { IPokerRule flush = null; if (HasSameSuit(cards) && !AllConsecutiveValue(cards)) { flush = new Flush() { HighCard = this.HighCard, HighValue = this.HighValue, Name = this.Name, Value = this.Value }; } return(flush); }
public IPokerRule CheckRule(List <Card> cards) { IPokerRule fullHouse = null; if (HasThreeSameValue(cards) && HasPair(cards)) { fullHouse = new FullHouse() { HighCard = this.HighCard, HighValue = this.HighValue, Name = this.Name, Value = this.Value }; } return(fullHouse); }
public IPokerRule CheckRule(List <Card> cards) { IPokerRule fourAKind = null; if (HasFourSameValue(cards)) { fourAKind = new FourAKind() { HighCard = this.HighCard, HighValue = this.HighValue, Name = this.Name, Value = this.Value }; } return(fourAKind); }
public IPokerRule CheckRule(List <Card> cards) { IPokerRule straightFlush = null; //TODO: FP-check if you need the final check if has all numeric since we may assign all values to each card as numeric this.IsValid = HasSameSuit(cards) && AllConsecutiveValue(cards) && HasAllNumericValue(cards); SetHighCard(cards); if (this.IsValid) { SetHighCard(cards); straightFlush = new StraightFlush() { HighCard = this.HighCard, HighValue = this.HighValue, Name = this.Name, Value = this.Value }; } return(straightFlush); }
public HandType(IPokerRule rule) { this.Rule = rule; }