Added player switches

This commit is contained in:
Speedy Gonzalez 2021-12-02 15:28:00 +01:00
parent d6c225a5aa
commit 68cc2402b4
1 changed files with 12 additions and 0 deletions

View File

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