java.lang.Object
com.example.project.services.SceneManager
Represents the scene manager class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SceneManager
void
initialise
(RootLayoutController theRootController, PageLoader loader) loads the fxml of all the scenes on launch to switch to via scene manaager.static void
injectForTests
(SceneManager newInstance, RootLayoutController newRootController, Map<GameScenes, GameScreenController> controllersToUse, Map<GameScenes, javafx.scene.Parent> pagesToUse) Helper method for tests.void
switchScene
(GameScenes type) Switch between scenes specifiy scene type of type fromGameScenes
.
-
Method Details
-
getInstance
- Returns:
- Gets the programs Scene Manager instance.
-
injectForTests
public static void injectForTests(SceneManager newInstance, RootLayoutController newRootController, Map<GameScenes, GameScreenController> controllersToUse, Map<GameScenes, javafx.scene.Parent> pagesToUse) Helper method for tests.- Parameters:
newInstance
- new Instance to inject.newRootController
- root layout controller.controllersToUse
- controllers to use.pagesToUse
- pages to use.
-
initialise
loads the fxml of all the scenes on launch to switch to via scene manaager.- Parameters:
theRootController
- the root Controller for the rootLayout scene.loader
- FXMLLoader
-
switchScene
Switch between scenes specifiy scene type of type fromGameScenes
.- Parameters:
type
- scene.
-