Package javatro.display.screens
Class RunSelectScreen
java.lang.Object
javatro.display.screens.Screen
javatro.display.screens.RunSelectScreen
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
-
Field Summary
Fields inherited from class javatro.display.screens.Screen
commandMap -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aRunSelectScreenwith a specified options menu title. -
Method Summary
Modifier and TypeMethodDescriptionvoidDisplays the screen content based on whether saved runs are available or not.static intRetrieves the current run number being displayed.static voidsetRunNumber(int runNumber) Sets the current run number to be displayed.Methods inherited from class javatro.display.screens.Screen
clearCommandMap, displayOptions, getCommand, getCommandMap, getOptionsSize, getOutput
-
Constructor Details
-
RunSelectScreen
Constructs aRunSelectScreenwith 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:
displayScreenin classScreen
-
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
-