Ejemplo n.º 1
0
        public override bool IsCheckingFinished(DescendingHandCards whiteCards, DescendingHandCards blackCards)
        {
            if (!HasResult && whiteCards.IsStraightFlushCards() && blackCards.IsStraightFlushCards())
            {
                Result = CompareSameType(whiteCards, blackCards);
            }

            if (!HasResult && (whiteCards.IsStraightFlushCards() || blackCards.IsStraightFlushCards()))
            {
                Result = DirectlyWin(whiteCards, blackCards);
            }

            return(HasResult);
        }
Ejemplo n.º 2
0
        protected override string DirectlyWin(DescendingHandCards whiteCards, DescendingHandCards blackCards)
        {
            if (whiteCards.IsStraightCards() &&
                !blackCards.IsStraightFlushCards() &&
                !blackCards.IsFourOfAKindCards() &&
                !blackCards.IsFullHouseCards() &&
                !blackCards.IsFlushCards())
            {
                HasResult = true;

                return(string.Format(StringConstant.WHITE_WIN_TEMPLATE, StringConstant.STRAIGHT));
            }

            if (blackCards.IsStraightCards() &&
                !whiteCards.IsStraightFlushCards() &&
                !whiteCards.IsFourOfAKindCards() &&
                !whiteCards.IsFullHouseCards() &&
                !whiteCards.IsFlushCards())
            {
                HasResult = true;

                return(string.Format(StringConstant.BLACK_WIN_TEMPLATE, StringConstant.STRAIGHT));
            }

            return(StringConstant.CHEAT);
        }
Ejemplo n.º 3
0
        protected override string DirectlyWin(DescendingHandCards whiteCards, DescendingHandCards blackCards)
        {
            if (whiteCards.IsStraightFlushCards() &&
                !blackCards.IsStraightFlushCards())
            {
                HasResult = true;

                return(string.Format(StringConstant.WHITE_WIN_TEMPLATE, StringConstant.STRAIGHT_FLUSH));
            }

            if (!whiteCards.IsStraightFlushCards() &&
                blackCards.IsStraightFlushCards())
            {
                HasResult = true;

                return(string.Format(StringConstant.BLACK_WIN_TEMPLATE, StringConstant.STRAIGHT_FLUSH));
            }

            return(StringConstant.TIE);
        }
Ejemplo n.º 4
0
        protected override string DirectlyWin(DescendingHandCards whiteCards, DescendingHandCards blackCards)
        {
            if (whiteCards.IsFourOfAKindCards() &&
                !blackCards.IsFourOfAKindCards() &&
                !blackCards.IsStraightFlushCards())
            {
                HasResult = true;

                return(string.Format(StringConstant.WHITE_WIN_TEMPLATE, StringConstant.FOUR_OF_A_KIND));
            }

            if (blackCards.IsFourOfAKindCards() &&
                !whiteCards.IsFourOfAKindCards() &&
                !whiteCards.IsStraightFlushCards())
            {
                HasResult = true;

                return(string.Format(StringConstant.BLACK_WIN_TEMPLATE, StringConstant.FOUR_OF_A_KIND));
            }

            return(StringConstant.TIE);
        }