Package struct

Class Key

java.lang.Object
struct.Key

public class Key extends Object
The class dealing with all possible keys used in the game.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    If the value is set to true, then the "A" button will be pressed.
    boolean
    If the value is set to true, then the "B" button will be pressed.
    boolean
    If the value is set to true, then the "C" button will be pressed.
    boolean
    If the value is set to true, then the "Down" button will be pressed.
    boolean
    If the value is set to true, then the "Left" button will be pressed.
    boolean
    If the value is set to true, then the "Right" button will be pressed.
    boolean
    If the value is set to true, then the "Up" button will be pressed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Resets all keys to false, or not pressed.
    int
    getLever(boolean isFront)
    Returns the value indicating the direction key input by the player using the numeric keypad.
    boolean
    Returns the flag whether or not the key is being pressed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • A

      public boolean A
      If the value is set to true, then the "A" button will be pressed.
    • B

      public boolean B
      If the value is set to true, then the "B" button will be pressed.
    • C

      public boolean C
      If the value is set to true, then the "C" button will be pressed.
    • U

      public boolean U
      If the value is set to true, then the "Up" button will be pressed.
    • R

      public boolean R
      If the value is set to true, then the "Right" button will be pressed.
    • D

      public boolean D
      If the value is set to true, then the "Down" button will be pressed.
    • L

      public boolean L
      If the value is set to true, then the "Left" button will be pressed.
  • Method Details

    • empty

      public void empty()
      Resets all keys to false, or not pressed.
    • isEmpty

      public boolean isEmpty()
      Returns the flag whether or not the key is being pressed.
      Returns:
      true if no key is being pressed, false otherwise
    • getLever

      public int getLever(boolean isFront)
      Returns the value indicating the direction key input by the player using the numeric keypad.
      Parameters:
      isFront - the boolean value representing the player's orientation
      Returns:
      the direction value from the numeric keypad