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())) { client.drawUpperTribeCard(myUsername, pos);
view.showError("It's not your turn!");
} else {
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())) { client.drawLowerTribeCard(myUsername, pos);
view.showError("It's not your turn!");
} else {
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())) { client.drawUpperBuildingCard(myUsername, pos);
view.showError("It's not your turn!");
} else {
client.drawUpperBuildingCard(myUsername, pos);
}
} }
/** /**
@@ -134,11 +125,7 @@ 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())) { client.drawLowerBuildingCard(myUsername, pos);
view.showError("It's not your turn!");
} else {
client.drawLowerBuildingCard(myUsername, pos);
}
} }
/** /**
@@ -148,11 +135,7 @@ 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())) { client.skipTurn(myUsername);
view.showError("It's not your turn!");
} else {
client.skipTurn(myUsername);
}
} }
/** /**
@@ -164,11 +147,7 @@ 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())) { client.slotChoice(myUsername, pos);
view.showError("It's not your turn!");
} else {
client.slotChoice(myUsername, pos);
}
} }
/** /**
@@ -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())) { client.totemChoice(myUsername, String.valueOf(miniModel.availableTotems.get(pos)));
view.showError("It's not your turn!");
} else {
client.totemChoice(myUsername, String.valueOf(miniModel.availableTotems.get(pos)));
}
} }
public void disconnect() public void disconnect()