Class JavatroManager

java.lang.Object
javatro.manager.JavatroManager
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class JavatroManager extends Object implements PropertyChangeListener
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 Details

    • ui

      public static UI ui
      The main view responsible for rendering the user interface.
    • jc

      public static JavatroCore jc
    • ante

      public static Ante ante
    • roundCount

      public static int roundCount
      The main model responsible for handling game logic.
    • runningTests

      public static boolean runningTests
  • Constructor Details

    • JavatroManager

      public JavatroManager(UI ui, JavatroCore jc) throws JavatroException
      Constructs a JavatroManager and 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

      public static void setScreen(Screen destinationScreen) throws JavatroException
      Changes the currently displayed screen.
      Parameters:
      destinationScreen - The new screen to be displayed.
      Throws:
      JavatroException
    • beginGame

      public static void beginGame(Deck.DeckType deckType) throws JavatroException
      Begins the game by initializing the game model and registering necessary observers.
      Throws:
      JavatroException - If an error occurs during game initialization.
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Handles property change events from the view. If the property change corresponds to user input, it executes the appropriate command.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      evt - The property change event.