Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }
Пример #9
0
 public HandType(IPokerRule rule)
 {
     this.Rule = rule;
 }