Class InputInterpreter

java.lang.Object
com.mg105.interface_adapters.InputInterpreter

public class InputInterpreter extends Object
InputInterpreter takes in keyboard inputs and distributes them to their appropriate use cases.
  • Constructor Details

    • InputInterpreter

      public InputInterpreter(@NotNull @NotNull CharacterMoverInterface mover, @NotNull @NotNull Toggler toggler, @NotNull @NotNull TutorialTextController textChanger, @NotNull @NotNull ChestInteractor chestInteractor, @NotNull @NotNull OpponentSetInteractor opponentInteractor)
      Create a new InputInterpreter that translates keyboard inputs to appropriate function invocations.
      Parameters:
      mover - the character mover.
      toggler - the toggler used to change the displayed interface.
      textChanger - the text controller for tutorial
      chestInteractor - the ChestInteractor used to interact with chests.
      opponentInteractor - the interactor used to interact with opponents.
  • Method Details

    • interpret

      public void interpret(String key)
      Interpret key being pressed as an action.
      Parameters:
      key - the key being pressed as a string.