Bug 501 - Player is unable to play Full House which has a higher rank than previous player's Full House
Summary: Player is unable to play Full House which has a higher rank than previous pla...
Status: CONFIRMED
Alias: None
Product: 2021A-CS3343-Gp17-Big2PokerGame
Classification: Unclassified
Component: Play (show other bugs)
Version: 2.0
Hardware: Macintosh Mac OS
: High critical
Assignee: CHAN Tsz Yin
URL:
Depends on:
Blocks:
 
Reported: 2020-12-01 00:52 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 00:52:00 HKT
Compare() does not cater to checking the rank of FULL HOUSE

private boolean compare(Combination previousCombination, Combination currentCombination, int numberOfCard) {
        
     if (currentCombination.getCardByIndex(numberOfCard).getValue() > 
         previousCombination.getCardByIndex(numberOfCard).getValue()) {
            return true;
        } else if (currentCombination.getCardByIndex(numberOfCard).getValue() == 
                   previousCombination.getCardByIndex(numberOfCard).getValue()) {
                       
                  if (currentCombination.getCardByIndex(numberOfCard).getSuit() 
                  > previousCombination.getCardByIndex(numberOfCard).getSuit()) {
                       return true;
                  } else {
                       return false;
                  }
                } else {
                    return false;
                }
        }