la til de nye skjermene i screenmanager

This commit is contained in:
Tobydrama 2020-03-31 15:08:24 +02:00
parent d8c6a8e04c
commit 167a94d607

View File

@ -8,6 +8,8 @@ public class ScreenManager {
private BoardActiveScreen boardActiveScreen; private BoardActiveScreen boardActiveScreen;
private CardChoiceScreen cardChoiceScreen; private CardChoiceScreen cardChoiceScreen;
private PowerDownScreen powerDownScreen; private PowerDownScreen powerDownScreen;
private LoadingScreen loadingScreen;
private StartMenuScreen startMenuScreen;
/** /**
* Gets an instance of the main menu screen * Gets an instance of the main menu screen
@ -21,6 +23,20 @@ public class ScreenManager {
return powerDownScreen; return powerDownScreen;
} }
public synchronized StartMenuScreen getStartMenuScreen(RoboRallyWrapper roboRallyWrapper) {
if (this.startMenuScreen == null) {
this.startMenuScreen = new StartMenuScreen(roboRallyWrapper);
}
return startMenuScreen;
}
public synchronized LoadingScreen getLoadingScreen(RoboRallyWrapper roboRallyWrapper) {
if (this.loadingScreen == null) {
this.loadingScreen = new LoadingScreen(roboRallyWrapper);
}
return loadingScreen;
}
/** /**
* Gets an instance of the main menu screen * Gets an instance of the main menu screen
* @param roboRallyWrapper The robo rally launcher instance to use * @param roboRallyWrapper The robo rally launcher instance to use