Package javatro.display.screens
Class CardSelectScreen
java.lang.Object
javatro.display.screens.Screen
javatro.display.screens.CardSelectScreen
- Direct Known Subclasses:
DiscardCardScreen,PlayCardScreen
Abstract base class for card selection screens with sorting and display capabilities.
Provides common functionality for:
- Displaying formatted card hands
- Handling card sorting operations
- Managing selection options
- Maintaining card display state
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSorting options for card display -
Field Summary
Fields inherited from class javatro.display.screens.Screen
commandMap -
Constructor Summary
ConstructorsConstructorDescriptionCardSelectScreen(String optionsTitle) Constructs a card selection screen with core functionality. -
Method Summary
Modifier and TypeMethodDescriptionvoidDisplays formatted card hand with borders and styling.abstract voidImplemented by subclasses to define screen-specific display logicprotected StringgetCardIndicesTitle(int cardCount) Generates formatted card index header for display.voidupdateHoldingHand(CardSelectScreen.SortOrder sortOrder) Updates and sorts the displayed hand according to specified order.Methods inherited from class javatro.display.screens.Screen
clearCommandMap, displayOptions, getCommand, getCommandMap, getOptionsSize, getOutput
-
Constructor Details
-
CardSelectScreen
Constructs a card selection screen with core functionality.- Parameters:
optionsTitle- Title for the options section- Throws:
JavatroException- if optionsTitle is invalid
-
-
Method Details
-
updateHoldingHand
Updates and sorts the displayed hand according to specified order.- Parameters:
sortOrder- Desired sorting order (null preserves current order)
-
getCardIndicesTitle
Generates formatted card index header for display.- Parameters:
cardCount- Number of cards in hand- Returns:
- Formatted string with numbered card positions
-
displayHoldingHand
public void displayHoldingHand()Displays formatted card hand with borders and styling. -
displayScreen
public abstract void displayScreen()Implemented by subclasses to define screen-specific display logic- Specified by:
displayScreenin classScreen
-