Class NumberedListInputScene

java.lang.Object
com.calebleavell.textinterface.scenes.GenericScene
com.calebleavell.textinterface.scenes.NumberedListInputScene
All Implemented Interfaces:
Function, Inputtable<Integer>, Scene

public class NumberedListInputScene extends GenericScene implements Inputtable<Integer>

NumberedListInputScene

Presents a list of items to choose from, then the user picks an option based on the corresponding number

  • Constructor Details

    • NumberedListInputScene

      public NumberedListInputScene(NumberedListInputScene.Builder builder)
      Return a new instance based on the builder fields
      Parameters:
      builder - The new NumberedListInputScene
  • Method Details

    • getNumberedList

      public NumberedListScene getNumberedList()
      Returns:
      The NumberedList of options
    • setList

      public void setList(NumberedListScene numberedList)
      Set the NumberedList
      Parameters:
      numberedList - The new NumberedList
    • getInputGetter

      public TextInputScene getInputGetter()
      Returns:
      The input collector, not the input itself
    • setInputGetter

      public void setInputGetter(TextInputScene inputGetter)
      Set the input collector
      Parameters:
      inputGetter - The new input collector
    • getInput

      public Integer getInput()
      Description copied from interface: Inputtable
      Getter for the input collected from the user
      Specified by:
      getInput in interface Inputtable<Integer>
      Returns:
      The user's input
    • run

      public void run() throws Exception
      Execute the program in the following order: 1. Numbered List 2. Get Input 3. Run super - runs children and functions
      Specified by:
      run in interface Function
      Overrides:
      run in class GenericScene
      Throws:
      Exception