| Summary: | The first player should not skip the first turn | ||
|---|---|---|---|
| Product: | 2021A-CS3343-Gp17-Big2PokerGame | Reporter: | yuctam4-c |
| Component: | GameController | Assignee: | 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 | ||
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();
}
|
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(); }