Class SceneManager

java.lang.Object
com.example.project.services.SceneManager

public class SceneManager extends Object
Represents the scene manager class.
  • Method Details

    • getInstance

      public static SceneManager 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

      public void initialise(RootLayoutController theRootController, PageLoader loader)
      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

      public void switchScene(GameScenes type)
      Switch between scenes specifiy scene type of type from GameScenes.
      Parameters:
      type - scene.