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); }
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); }