Class InputFactory

java.lang.Object
com.csse3200.game.input.InputFactory
Direct Known Subclasses:
KeyboardInputFactory, TouchInputFactory

public abstract class InputFactory extends Object
InputFactory creates inputType-specific inputFactories which can handle various types of input. Currently only keyboard input and touch is implemented, but InputFactory can be expanded to include more, e.g. touch gestures.

Methods to get new input handlers should be defined here.

  • Constructor Details

    • InputFactory

      public InputFactory()
  • Method Details

    • createFromInputType

      public static InputFactory createFromInputType(InputFactory.InputType inputType)
      Parameters:
      inputType - the type of input ot be handled by the game
      Returns:
      an InputFactory for the specified input type
    • createForPlayer

      public abstract InputComponent createForPlayer()
      Creates an input handler for the player
      Returns:
      Player input handler
    • createForTerminal

      public abstract InputComponent createForTerminal()
      Creates an input handler for the terminal
      Returns:
      Terminal input handler