Enum Class Actions

java.lang.Object
java.lang.Enum<Actions>
nz.ac.vuw.ecs.swen225.gp6.app.utilities.Actions
All Implemented Interfaces:
Serializable, Comparable<Actions>, Constable

public enum Actions extends Enum<Actions>
This class is used to define the actions that can be performed by the user.
  • Enum Constant Details

    • MOVE_UP

      public static final Actions MOVE_UP
      Represents the move player move up.
    • MOVE_DOWN

      public static final Actions MOVE_DOWN
      Represents the move player move down.
    • MOVE_LEFT

      public static final Actions MOVE_LEFT
      Represents the move player move left.
    • MOVE_RIGHT

      public static final Actions MOVE_RIGHT
      Represents the move player move right.
    • PAUSE_GAME

      public static final Actions PAUSE_GAME
      Represents the action pausing game.
    • RESUME_GAME

      public static final Actions RESUME_GAME
      Represents the action resuming game.
    • TO_LEVEL_1

      public static final Actions TO_LEVEL_1
      Represents the action jump straight to level 1.
    • TO_LEVEL_2

      public static final Actions TO_LEVEL_2
      Represents the action jump straight to level 2.
    • LOAD_GAME

      public static final Actions LOAD_GAME
      Represents the action reloading from saved game.
    • SAVE_GAME

      public static final Actions SAVE_GAME
      Represents the action saving and quit game.
    • QUIT_TO_MENU

      public static final Actions QUIT_TO_MENU
      Represents the action quitting without saving game.
    • NONE

      public static final Actions NONE
      Represents no action is being performed.
  • Method Details

    • values

      public static Actions[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Actions valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • run

      public void run(App app)
      Runs the action associated with the enum.
      Parameters:
      app - The app object that the action will be performed on.
    • replay

      public void replay(App app)
      Replays the action associated with the enum.
      Parameters:
      app - The app object that the action will be performed on.
    • getDisplayName

      public String getDisplayName()
      Gets the display name of the action.
      Returns:
      the display name of the action.