mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
endre til et annet screen
This commit is contained in:
parent
0ddf309e70
commit
cafde5245d
@ -47,13 +47,17 @@ public class LoadingScreen extends AbstractScreen {
|
||||
roboRallyWrapper.batch.end();
|
||||
long time = System.currentTimeMillis();
|
||||
//TODO: Allow to set any condition and next screen
|
||||
if (roboRallyWrapper.roboRallyGame.getGameState() != initialGameState) {
|
||||
if (roboRallyWrapper.roboRallyGame != null && roboRallyWrapper.roboRallyGame.getGameState() != initialGameState ) {
|
||||
handleScreenChange();
|
||||
}
|
||||
}
|
||||
|
||||
private void handleScreenChange() {
|
||||
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getBoardActiveScreen(this.roboRallyWrapper));
|
||||
switch (initialGameState) {
|
||||
case SENDING_CARDS:
|
||||
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getBoardActiveScreen(this.roboRallyWrapper));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -64,7 +68,12 @@ public class LoadingScreen extends AbstractScreen {
|
||||
@Override
|
||||
public void show() {
|
||||
startTime = System.currentTimeMillis();
|
||||
initialGameState = roboRallyWrapper.roboRallyGame.getGameState();
|
||||
if (roboRallyWrapper.roboRallyGame == null){
|
||||
initialGameState = GameState.INITIAL_SETUP;
|
||||
}
|
||||
else {
|
||||
initialGameState = roboRallyWrapper.roboRallyGame.getGameState();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user