Merge remote-tracking branch 'origin/main'

This commit is contained in:
Leonardo Brandenberger 2021-12-02 15:37:36 +01:00
commit 60d1c9a90b
1 changed files with 12 additions and 0 deletions

View File

@ -59,6 +59,12 @@ public class SiedlerGame {
*/ */
public void switchToNextPlayer() { public void switchToNextPlayer() {
// TODO: Implement // TODO: Implement
if (activePlayer < allPlayers.size()){
activePlayer++;
}
else if (activePlayer == allPlayers.size()){
activePlayer = 0;
}
} }
/** /**
@ -66,6 +72,12 @@ public class SiedlerGame {
*/ */
public void switchToPreviousPlayer() { public void switchToPreviousPlayer() {
// TODO: Implement // TODO: Implement
if (activePlayer > 0){
activePlayer--;
}
else if (activePlayer == 0){
activePlayer = allPlayers.size()-1;
}
} }
/** /**