Added player switches
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user