mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 15:19:35 +01:00
fixed some bugs with powerdown screens
This commit is contained in:
parent
cab21fb0fa
commit
507ec6ed4a
@ -43,13 +43,13 @@ class RoboRallyClientListener extends Listener {
|
||||
wrapper.server != null, info.getPlayerName(), wrapper.server);
|
||||
} else if (object instanceof ProgrammingCardDeck) {
|
||||
if(((ProgrammingCardDeck) object).isEmpty()){
|
||||
wrapper.roboRallyGame.setProgram(new ArrayList<>());
|
||||
if (wrapper.roboRallyGame.getRobotPowerdown()){
|
||||
wrapper.roboRallyGame.setGameState(GameState.SKIP_POWER_DOWN_SCREEN);
|
||||
}
|
||||
else {
|
||||
wrapper.roboRallyGame.setGameState(GameState.CHOOSING_POWER_DOWN);
|
||||
}
|
||||
wrapper.roboRallyGame.setProgram(new ArrayList<>());
|
||||
}
|
||||
else {wrapper.roboRallyGame.setGameState(GameState.CHOOSING_CARDS);}
|
||||
new Thread(() -> wrapper.roboRallyGame.setPlayerHand((ProgrammingCardDeck) object)).start();
|
||||
|
@ -4,7 +4,7 @@ package inf112.fiasko.roborally.networking.containers;
|
||||
* This class represents a response saying that something went wrong with the request
|
||||
*/
|
||||
public class ErrorResponse {
|
||||
private final String errorMessage;
|
||||
private String errorMessage;
|
||||
private boolean critical;
|
||||
|
||||
/**
|
||||
@ -16,6 +16,9 @@ public class ErrorResponse {
|
||||
this.errorMessage = errorMessage;
|
||||
this.critical = false;
|
||||
}
|
||||
public ErrorResponse(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new error response
|
||||
|
@ -181,11 +181,10 @@ public class RoboRallyGame implements DrawableGame, InteractableGame {
|
||||
removeNonLockedProgrammingCardsFromPlayers();
|
||||
}
|
||||
|
||||
if (gameBoard.getPowerDown(Objects.requireNonNull(getPlayerFromName(this.playerName)).getRobotID())) {
|
||||
if (getPlayerFromName(this.playerName)!=null&& gameBoard.getPowerDown(Objects.requireNonNull(getPlayerFromName(this.playerName)).getRobotID())) {
|
||||
setGameState(GameState.CHOOSING_STAY_IN_POWER_DOWN);
|
||||
} else {
|
||||
setGameState(GameState.LOADING);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user