Bug 502

Summary: The system identifies valid THREE OF KIND play as invalid.
Product: 2021A-CS3343-Gp17-Big2PokerGame Reporter: hwchan58-c
Component: PlayAssignee: CHAN Tsz Yin <tychan423-c>
Status: CONFIRMED ---    
Severity: critical CC: hwchan58-c, kaschung4-c, waisumpo2-c, yuctam4-c, yuenchong9-c
Priority: High    
Version: 1.0   
Hardware: PC   
OS: Mac OS   

Description hwchan58-c 2020-12-01 01:13:43 HKT
This bug is related to the following code in isValidPlay().

if(currentType == previousType){
   switch (currentType) {
       case SINGLE:
            valid = compare(previousCombination, currentCombination, 0);
            break;
       case PAIR:
            valid = compare(previousCombination, currentCombination, 1);
            break;
       case THREE_OF_KIND:
       case FULL_HOUSE:
            valid = compare(previousCombination, currentCombination, 2);
            break;
       case FOUR_PLUS_ONE:
            valid = compare(previousCombination, currentCombination, 3);
            break;
       case STRAIGHT_FLUSH:
       case STRAIGHT:
            valid = compare(previousCombination, currentCombination, 4);
            break;
       case FLUSH:
            if (previousCombination.getCardByIndex(0).getSuit() > 
                currentCombination.getCardByIndex(0).getSuit()) {
                     valid = false;
            } else if (previousCombination.getCardByIndex(0).getSuit() < 
                       currentCombination.getCardByIndex(0).getSuit()) {
                                valid = true;
                   } else if (currentCombination.getCardByIndex(4).getValue() > 
                              previousCombination.getCardByIndex(4).getValue()) {
                                    valid = true;
                          } else {
                                    valid = false;
                          }
                    break;
       default:
       valid = false;
}