Removed: client side player turn control

This commit is contained in:
rubenpirreram
2026-05-26 17:51:30 +02:00
parent bbeec46ca2
commit 3169745cda
@@ -86,11 +86,8 @@ public class ClientController {
* @param pos the index of the card to draw. * @param pos the index of the card to draw.
*/ */
public void drawUpperTribeCard(int pos) { 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. * @param pos the index of the card to draw.
*/ */
public void drawLowerTribeCard(int pos) { 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. * @param pos the index of the card to draw.
*/ */
public void drawUpperBuildingCard(int pos) { 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,12 +125,8 @@ public class ClientController {
* @param pos the index of the card to draw. * @param pos the index of the card to draw.
*/ */
public void drawLowerBuildingCard(int pos) { 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);
} }
}
/** /**
* Requests to skip the current turn. * Requests to skip the current turn.
@@ -148,12 +135,8 @@ public class ClientController {
* is shown. Otherwise, the request is forwarded to the network client. * is shown. Otherwise, the request is forwarded to the network client.
*/ */
public void skipTurn() { 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);
} }
}
/** /**
* Requests the selection of a slot by the specified player. * Requests the selection of a slot by the specified player.
@@ -164,12 +147,8 @@ public class ClientController {
* @param pos the index of the selected slot. * @param pos the index of the selected slot.
*/ */
public void slotChoice(int pos) { 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);
} }
}
/** /**
* Handles the selection of a totem by the specified player. * Handles the selection of a totem by the specified player.
@@ -181,11 +160,8 @@ public class ClientController {
* @param pos the index of the selected totem in the available totems list. * @param pos the index of the selected totem in the available totems list.
*/ */
public void totemChoice(int pos) { 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() public void disconnect()