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