Enum Class Actions
- All Implemented Interfaces:
Serializable,Comparable<Actions>,Constable
This class is used to define the actions that can be performed by the user.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents the action reloading from saved game.Represents the move player move down.Represents the move player move left.Represents the move player move right.Represents the move player move up.Represents no action is being performed.Represents the action pausing game.Represents the action quitting without saving game.Represents the action resuming game.Represents the action saving and quit game.Represents the action jump straight to level 1.Represents the action jump straight to level 2. -
Method Summary
Modifier and TypeMethodDescriptionGets the display name of the action.voidReplays the action associated with the enum.voidRuns the action associated with the enum.static ActionsReturns the enum constant of this class with the specified name.static Actions[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MOVE_UP
Represents the move player move up. -
MOVE_DOWN
Represents the move player move down. -
MOVE_LEFT
Represents the move player move left. -
MOVE_RIGHT
Represents the move player move right. -
PAUSE_GAME
Represents the action pausing game. -
RESUME_GAME
Represents the action resuming game. -
TO_LEVEL_1
Represents the action jump straight to level 1. -
TO_LEVEL_2
Represents the action jump straight to level 2. -
LOAD_GAME
Represents the action reloading from saved game. -
SAVE_GAME
Represents the action saving and quit game. -
QUIT_TO_MENU
Represents the action quitting without saving game. -
NONE
Represents no action is being performed.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
run
Runs the action associated with the enum.- Parameters:
app- The app object that the action will be performed on.
-
replay
Replays the action associated with the enum.- Parameters:
app- The app object that the action will be performed on.
-
getDisplayName
Gets the display name of the action.- Returns:
- the display name of the action.
-