diff --git a/src/main/java/it/polimi/ingsw/gc14/Controller/ClientController.java b/src/main/java/it/polimi/ingsw/gc14/Controller/ClientController.java index d534991..a37f39c 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Controller/ClientController.java +++ b/src/main/java/it/polimi/ingsw/gc14/Controller/ClientController.java @@ -86,11 +86,8 @@ public class ClientController { * @param pos the index of the card to draw. */ public void drawUpperTribeCard(int pos) { - if (!Objects.equals(myUsername, miniModel.currentState.getCurrentPlayer().getUserName())) { - view.showError("It's not your turn!"); - } else { - client.drawUpperTribeCard(myUsername, pos); - } + client.drawUpperTribeCard(myUsername, pos); + } /** @@ -102,11 +99,8 @@ public class ClientController { * @param pos the index of the card to draw. */ public void drawLowerTribeCard(int pos) { - if (!Objects.equals(myUsername, miniModel.currentState.getCurrentPlayer().getUserName())) { - view.showError("It's not your turn!"); - } else { - client.drawLowerTribeCard(myUsername, pos); - } + client.drawLowerTribeCard(myUsername, pos); + } /** @@ -118,11 +112,8 @@ public class ClientController { * @param pos the index of the card to draw. */ public void drawUpperBuildingCard(int pos) { - if (!Objects.equals(myUsername, miniModel.currentState.getCurrentPlayer().getUserName())) { - view.showError("It's not your turn!"); - } else { - client.drawUpperBuildingCard(myUsername, pos); - } + client.drawUpperBuildingCard(myUsername, pos); + } /** @@ -134,11 +125,7 @@ public class ClientController { * @param pos the index of the card to draw. */ public void drawLowerBuildingCard(int pos) { - if (!Objects.equals(myUsername, miniModel.currentState.getCurrentPlayer().getUserName())) { - view.showError("It's not your turn!"); - } else { - client.drawLowerBuildingCard(myUsername, pos); - } + client.drawLowerBuildingCard(myUsername, pos); } /** @@ -148,11 +135,7 @@ public class ClientController { * is shown. Otherwise, the request is forwarded to the network client. */ public void skipTurn() { - if (!Objects.equals(myUsername, miniModel.currentState.getCurrentPlayer().getUserName())) { - view.showError("It's not your turn!"); - } else { - client.skipTurn(myUsername); - } + client.skipTurn(myUsername); } /** @@ -164,11 +147,7 @@ public class ClientController { * @param pos the index of the selected slot. */ public void slotChoice(int pos) { - if (!Objects.equals(myUsername, miniModel.currentState.getCurrentPlayer().getUserName())) { - view.showError("It's not your turn!"); - } else { - client.slotChoice(myUsername, pos); - } + client.slotChoice(myUsername, pos); } /** @@ -181,11 +160,8 @@ public class ClientController { * @param pos the index of the selected totem in the available totems list. */ public void totemChoice(int pos) { - if (!Objects.equals(myUsername, miniModel.currentState.getCurrentPlayer().getUserName())) { - view.showError("It's not your turn!"); - } else { - client.totemChoice(myUsername, String.valueOf(miniModel.availableTotems.get(pos))); - } + client.totemChoice(myUsername, String.valueOf(miniModel.availableTotems.get(pos))); + } public void disconnect()