コード例 #1
0
        public override bool IsCheckingFinished(DescendingHandCards whiteCards, DescendingHandCards blackCards)
        {
            if (!HasResult && whiteCards.IsThreeOfAKindCards() && blackCards.IsThreeOfAKindCards())
            {
                Result = CompareSameType(whiteCards, blackCards);
            }

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

            return(HasResult);
        }
コード例 #2
0
        protected override string DirectlyWin(DescendingHandCards whiteCards, DescendingHandCards blackCards)
        {
            if (whiteCards.IsThreeOfAKindCards() &&
                (blackCards.IsMessyCards() ||
                 blackCards.IsOnePairCards() ||
                 blackCards.IsTwoPairsCards()))
            {
                HasResult = true;

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

            if (blackCards.IsThreeOfAKindCards() &&
                (whiteCards.IsMessyCards() ||
                 whiteCards.IsOnePairCards() ||
                 whiteCards.IsTwoPairsCards()))
            {
                HasResult = true;

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

            return(StringConstant.TIE);
        }