Fix: only one skipAction(Del:SkipLower/SkipUpper)

This commit is contained in:
rubenpirreram
2026-05-07 13:12:22 +02:00
parent ee5b69a900
commit 490f8fbfaa
13 changed files with 184 additions and 227 deletions
@@ -145,16 +145,16 @@ public class ClientController {
/**
* Requests to skip drawing from the upper list.
* This action is available only when the upper list is empty or the player cannot draw any card.
* Requests to skip turn .
* This action is available only when the player cannot draw any tribe card.
* @param playerUsername the name of the player performing the action
*/
public void skipUpper(String playerUsername) {
public void skipTurn(String playerUsername) {
if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName()))
view.showError("It's not your turn!");
else {
try {
client.skipUpper(playerUsername);
client.skipTurn(playerUsername);
} catch (RemoteException e) {
throw new RuntimeException(e);
}
@@ -162,22 +162,6 @@ public class ClientController {
}
/**
* Requests to skip drawing from the lower list.
* This action is available only when the lower list is empty or the player cannot draw any card.
* @param playerUsername the name of the player performing the action
*/
public void skipLower(String playerUsername) {
if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName()))
view.showError("It's not your turn!");
else {
try {
client.skipLower(playerUsername);
} catch (RemoteException e) {
throw new RuntimeException(e);
}
}
}
/**