Class ControllerImpl

java.lang.Object
ca.uqam.info.student.skyjo.controller.ControllerImpl
All Implemented Interfaces:
ca.uqam.info.max.skyjo.controller.Controller

public class ControllerImpl extends Object implements ca.uqam.info.max.skyjo.controller.Controller
Interface for controller. Use this interface to implement your MVC controller.
Author:
Maximilian Schiedermeier
  • Constructor Details

    • ControllerImpl

      public ControllerImpl()
      Default constructor.
  • Method Details

    • initializeModel

      public void initializeModel(ca.uqam.info.max.skyjo.controller.ModelPreset preset, String[] players, Random seed)
      Created a new model. Must internally use the model factory to encapsulate complexity.
      Specified by:
      initializeModel in interface ca.uqam.info.max.skyjo.controller.Controller
      Parameters:
      preset - as the layout configuration for the Skyjo session.
      players - as the player names in String array format.
      seed - as object used for pseudo-random decision-making. Shuffling etc is skipped if null.
    • getModel

      public ca.uqam.info.max.skyjo.model.SkyjoModelReadOnly getModel()
      Specified by:
      getModel in interface ca.uqam.info.max.skyjo.controller.Controller
    • addModelObserver

      public void addModelObserver(ca.uqam.info.max.skyjo.controller.ModelObserver observer)
      Specified by:
      addModelObserver in interface ca.uqam.info.max.skyjo.controller.Controller
    • getCurrentPlayerCommands

      public ca.uqam.info.max.skyjo.controller.Command[] getCurrentPlayerCommands()
      Specified by:
      getCurrentPlayerCommands in interface ca.uqam.info.max.skyjo.controller.Controller
    • doCommand

      public void doCommand(int i)
      Specified by:
      doCommand in interface ca.uqam.info.max.skyjo.controller.Controller
    • isUndoAvailable

      public boolean isUndoAvailable()
      Specified by:
      isUndoAvailable in interface ca.uqam.info.max.skyjo.controller.Controller
    • undoLastCommand

      public void undoLastCommand()
      Specified by:
      undoLastCommand in interface ca.uqam.info.max.skyjo.controller.Controller