Package javatro.manager
Class JavatroManager
java.lang.Object
javatro.manager.JavatroManager
- All Implemented Interfaces:
PropertyChangeListener,EventListener
The
JavatroManager class serves as the main controller (manager) of the game,
coordinating interactions between the model (JavatroCore) and the view (display).
It listens for property changes and updates the game state accordingly.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Antestatic JavatroCorestatic intThe main model responsible for handling game logic.static booleanstatic UIThe main view responsible for rendering the user interface. -
Constructor Summary
ConstructorsConstructorDescriptionJavatroManager(UI ui, JavatroCore jc) Constructs aJavatroManagerand registers it as an observer to the view. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbeginGame(Deck.DeckType deckType) Begins the game by initializing the game model and registering necessary observers.voidHandles property change events from the view.static voidChanges the currently displayed screen.
-
Field Details
-
ui
The main view responsible for rendering the user interface. -
jc
-
ante
-
roundCount
public static int roundCountThe main model responsible for handling game logic. -
runningTests
public static boolean runningTests
-
-
Constructor Details
-
JavatroManager
Constructs aJavatroManagerand registers it as an observer to the view.- Parameters:
ui- The main view of the game.jc- The main model of the game.- Throws:
JavatroException
-
-
Method Details
-
setScreen
Changes the currently displayed screen.- Parameters:
destinationScreen- The new screen to be displayed.- Throws:
JavatroException
-
beginGame
Begins the game by initializing the game model and registering necessary observers.- Throws:
JavatroException- If an error occurs during game initialization.
-
propertyChange
Handles property change events from the view. If the property change corresponds to user input, it executes the appropriate command.- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
evt- The property change event.
-