Class RunSelectScreen

java.lang.Object
javatro.display.screens.Screen
javatro.display.screens.RunSelectScreen

public class RunSelectScreen extends Screen
The RunSelectScreen class represents a screen used to select and load runs within the game. It displays saved runs or prompts the user to start a new run if no runs are found.

This class is part of the javatro.display.screens package and extends the Screen class, inheriting its basic screen functionalities. It interacts with the Storage class to retrieve stored runs and displays them using formatted content through the DisplayFormatter class.

Author: @@flyingapricot

  • Constructor Details

    • RunSelectScreen

      public RunSelectScreen() throws JavatroException
      Constructs a RunSelectScreen with a specified options menu title. If saved runs are found, corresponding options are added to the command map.
      Throws:
      JavatroException - if optionsTitle is null or empty
  • Method Details

    • displayScreen

      public void displayScreen()
      Displays the screen content based on whether saved runs are available or not. If runs are found, formatted run information is displayed. Otherwise, a message prompting the user to start a new run is shown.
      Specified by:
      displayScreen in class Screen
    • getRunNumber

      public static int getRunNumber()
      Retrieves the current run number being displayed.
      Returns:
      the current run number
    • setRunNumber

      public static void setRunNumber(int runNumber)
      Sets the current run number to be displayed.
      Parameters:
      runNumber - the run number to set