Package javatro.display.screens
Class RunListScreen
java.lang.Object
javatro.display.screens.Screen
javatro.display.screens.RunListScreen
Represents the screen that displays the list of saved game runs.
This screen is responsible for:
- Fetching the list of saved game runs from
Storage - Dynamically generating menu options for each saved run
- Providing a user interface for selecting a specific run to view
Extends Screen and overrides its display handling mechanism.
-
Field Summary
Fields inherited from class javatro.display.screens.Screen
commandMap -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the RunListScreen by retrieving the saved runs from storage and creating correspondingViewRunOptionobjects for each run. -
Method Summary
Modifier and TypeMethodDescriptionvoidDisplays the list of saved runs on the screen.Methods inherited from class javatro.display.screens.Screen
clearCommandMap, displayOptions, getCommand, getCommandMap, getOptionsSize, getOutput
-
Constructor Details
-
RunListScreen
Constructs the RunListScreen by retrieving the saved runs from storage and creating correspondingViewRunOptionobjects for each run.The options are then added to the command map for user interaction.
- Throws:
JavatroException- if there is an error initializing the screen, such as issues with accessing theStorageinstance or fetching run data.
-
-
Method Details
-
displayScreen
public void displayScreen()Displays the list of saved runs on the screen.This method is responsible for rendering:
- The screen title: "List of Saved Runs"
- Menu options dynamically generated from saved run data
Actual rendering of the menu options is handled by the superclass.
- Specified by:
displayScreenin classScreen
-