mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Forbedrer feilmelding for eventuelle roboter som tilhører spillere men som ikke eksisterer
This commit is contained in:
parent
196edaaf10
commit
cd92a14c6d
@ -201,7 +201,8 @@ public class BoardActiveScreen extends AbstractScreen implements InputProcessor
|
|||||||
String playerName = player.getName();
|
String playerName = player.getName();
|
||||||
Robot robot = getPlayersRobot(player.getRobotID());
|
Robot robot = getPlayersRobot(player.getRobotID());
|
||||||
if (robot == null) {
|
if (robot == null) {
|
||||||
throw new NullPointerException("Player's robot does not exist.");
|
throw new IllegalArgumentException("The robot belonging to player " + playerName +
|
||||||
|
" does not exist on the board.");
|
||||||
}
|
}
|
||||||
roboRallyWrapper.font.draw(batch, playerName, viewPortWidth, 128 * index);
|
roboRallyWrapper.font.draw(batch, playerName, viewPortWidth, 128 * index);
|
||||||
roboRallyWrapper.font.draw(batch, "DMG: " + robot.getDamageTaken() + " LV: " + robot.getAmountOfLives(),
|
roboRallyWrapper.font.draw(batch, "DMG: " + robot.getDamageTaken() + " LV: " + robot.getAmountOfLives(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user