diff --git a/bin/cards/maumau/model/PlayerHandler.class b/bin/cards/maumau/model/PlayerHandler.class index d52ee66..580b21d 100644 Binary files a/bin/cards/maumau/model/PlayerHandler.class and b/bin/cards/maumau/model/PlayerHandler.class differ diff --git a/src/cards/maumau/model/PlayerHandler.java b/src/cards/maumau/model/PlayerHandler.java index 70402af..85d9819 100644 --- a/src/cards/maumau/model/PlayerHandler.java +++ b/src/cards/maumau/model/PlayerHandler.java @@ -19,11 +19,14 @@ public class PlayerHandler { public PlayerHandler(MauMau game) { this.game = game; + + //Initialize all the States to be used this.waitForNextTurnState = new WaitForNextTurnState(this); this.waitForMauState = new WaitForMauState(this); this.waitForMauMauState = new WaitForMauMauState(this); this.finishedState = new FinishedState(); + //set waitingForNextTurnState as default this.currentState = waitForNextTurnState; } @@ -48,15 +51,17 @@ public class PlayerHandler { } public void addPlayer(Player player) { - // Add player logic + players.addLast(player); } public void localNextTurn(int n) { - // Local next turn logic + for(int i = 0; i < n; i++){ + players.addLast(players.getFirst()); + } } public void finishPlayer(Player p) { - // Finish player logic + ranking.addLast(players.removeFirst()); } public Player getCurrentPlayer() { @@ -92,6 +97,6 @@ public class PlayerHandler { } public void finishGame() { - // Finish game logic + finishPlayer(players.getFirst()); } }