Class NumberedSceneSelectorScene
java.lang.Object
com.calebleavell.textinterface.scenes.GenericScene
com.calebleavell.textinterface.scenes.NumberedSceneSelectorScene
NumberedSceneSelectorScene Class
Utilizes a NumberedListInputScene to create a scene-selection mechanism
Much easier to construct than building a scene selector manually
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.calebleavell.textinterface.scenes.GenericScene
MAX_ITERATIONS_ON_TOSTRING
-
Constructor Summary
ConstructorsConstructorDescriptionReturn a new instance based on the builder fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new scene to choose fromvoid
run()
display displays the selector, gets the input, then display the chosen scene NOTE: all child scenes and functions will be ran BEFORE the selected scene is displayedtoString
(int indent, boolean displayChildren) Overrides GenericScene's toString to include it's scene optionsMethods inherited from class com.calebleavell.textinterface.scenes.GenericScene
addChild, executeFunctions, getChild, getChild, getChild, getChild, getChildren, getFunctions, getID, getName, isTerminated, runChildren, setChildren, setName, terminate, toString
-
Constructor Details
-
NumberedSceneSelectorScene
Return a new instance based on the builder fields- Parameters:
builder
- The new NumberedSceneSelectorScene
-
-
Method Details
-
addScene
Adds a new scene to choose from- Parameters:
newScene
- The new scenetext
- The display text of the option
-
run
display displays the selector, gets the input, then display the chosen scene NOTE: all child scenes and functions will be ran BEFORE the selected scene is displayed- Specified by:
run
in interfaceFunction
- Overrides:
run
in classGenericScene
- Throws:
Exception
-
toString
Overrides GenericScene's toString to include it's scene options- Specified by:
toString
in interfaceScene
- Overrides:
toString
in classGenericScene
- Parameters:
indent
- the amount of spacing (increases deeper into the layers of children)displayChildren
- Whether or not to include children in the toString- Returns:
- the formatted string of the object and its children
-