Package javatro.manager.options
Class DeckSelectOption
java.lang.Object
javatro.manager.options.DeckSelectOption
- All Implemented Interfaces:
Option
Represents a menu option for selecting a specific deck type to start a new game. When executed,
initializes the game with the specified deck and transitions to the blind screen.
-
Constructor Summary
ConstructorsConstructorDescriptionDeckSelectOption(String description, Deck.DeckType deckType) Constructs a deck selection option with specified description and deck type. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the command.Retrieves a description of the command.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javatro.manager.options.Option
setDescription
-
Constructor Details
-
DeckSelectOption
Constructs a deck selection option with specified description and deck type.- Parameters:
description- User-visible description of the optiondeckType- The type of deck to initialize when selected- Throws:
NullPointerException- if description or deckType are null
-
-
Method Details
-
getDescription
Retrieves a description of the command. This method has a default implementation returning an empty string.- Specified by:
getDescriptionin interfaceOption- Returns:
- The description text for this deck selection option
-
execute
Executes the command. Implementing classes must define specific behavior. Initializes game with selected deck type and transitions to blind screen.- Specified by:
executein interfaceOption- Throws:
JavatroException- if game initialization fails
-