Bug 502 - The system identifies valid THREE OF KIND play as invalid.
Summary: The system identifies valid THREE OF KIND play as invalid.
Status: CONFIRMED
Alias: None
Product: 2021A-CS3343-Gp17-Big2PokerGame
Classification: Unclassified
Component: Play (show other bugs)
Version: 1.0
Hardware: PC Mac OS
: High critical
Assignee: CHAN Tsz Yin
URL:
Depends on:
Blocks:
 
Reported: 2020-12-01 01:13 HKT by hwchan58-c
Modified: 2020-12-04 14:13 HKT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;
}