Enum Class GameControls.GameState
- All Implemented Interfaces:
Serializable, Comparable<GameControls.GameState>, Constable
- Enclosing interface:
GameControls
Specifies a game state for Tetris. The implementing class of the GameControls interface
will always be in one of these defined states.
- Version:
- Winter 2025
- Author:
- Charles Bryan
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic GameControls.GameStateReturns the enum constant of this class with the specified name.static GameControls.GameState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NEW
A new Tetris game has started. The game is not yet RUNNING. It may not become PAUSED or OVER. The next state is RUNNING. -
RUNNING
A Tetris game is RUNNING. The game is not PAUSED or over but may become PAUSED or OVER. -
PAUSED
A tetris game is PAUSED. The game is not OVER. -
OVER
A Tetris game is OVER. It may not be PAUSED. It may not become RUNNING without requesting a new game.
-
-
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
-