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

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

            return(HasResult);
        }
Exemplo n.º 2
0
        protected override string DirectlyWin(DescendingHandCards whiteCards, DescendingHandCards blackCards)
        {
            if (whiteCards.IsTwoPairsCards() && (blackCards.IsMessyCards() || blackCards.IsOnePairCards()))
            {
                HasResult = true;
                return(string.Format(StringConstant.WHITE_WIN_TEMPLATE, StringConstant.TWO_PAIRS));
            }

            if (blackCards.IsTwoPairsCards() && (whiteCards.IsMessyCards() || whiteCards.IsOnePairCards()))
            {
                HasResult = true;
                return(string.Format(StringConstant.BLACK_WIN_TEMPLATE, StringConstant.TWO_PAIRS));
            }

            return(StringConstant.TIE);
        }