Bug 509

Summary: The first player should not skip the first turn
Product: 2021A-CS3343-Gp17-Big2PokerGame Reporter: yuctam4-c
Component: GameControllerAssignee: CHAN Tsz Yin <tychan423-c>
Status: RESOLVED FIXED    
Severity: critical CC: hwchan58-c, kaschung4-c, waisumpo2-c, yuctam4-c, yuenchong9-c
Priority: High    
Version: 1.0   
Hardware: PC   
OS: Windows   

Description yuctam4-c 2020-12-03 10:46:23 HKT
As the principal of the game, the first player in the first turn in first round is not allowed to skip the turn. The related Code show below:

    public void skip() {
        if (skipCount < 4) {
            addHistory(currentPlayer.getName(), null);
            handleSkipPlay();
            currentPlayerIndex = nextPlayerIndex();
            skipCount++;
            turn++;
        } else {
            System.out.print("Your cannot skip! Please choose again!\n");
            pause();
        }
        incrementRound();
    }
Comment 2 yuctam4-c 2020-12-03 10:50:42 HKT
Bug Solved by adding new checking function isFirstPlayer():

 public void skip() {
        if (skipCount < 4 && !isFirstPlayer) {
            addHistory(currentPlayer.getName(), null);
            handleSkipPlay();
            currentPlayerIndex = nextPlayerIndex();
            skipCount++;
            turn++;
        } else {
            System.out.print("Your cannot skip! Please choose again!\n");
            pause();
        }
        incrementRound();
    }