Class ControllerImpl
java.lang.Object
ca.uqam.info.student.skyjo.controller.ControllerImpl
- All Implemented Interfaces:
ca.uqam.info.max.skyjo.controller.Controller
Interface for controller. Use this interface to implement your MVC controller.
- Author:
- Maximilian Schiedermeier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModelObserver(ca.uqam.info.max.skyjo.controller.ModelObserver observer) voiddoCommand(int i) ca.uqam.info.max.skyjo.controller.Command[]ca.uqam.info.max.skyjo.model.SkyjoModelReadOnlygetModel()voidinitializeModel(ca.uqam.info.max.skyjo.controller.ModelPreset preset, String[] players, Random seed) Created a new model.booleanvoid
-
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:
initializeModelin interfaceca.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:
getModelin interfaceca.uqam.info.max.skyjo.controller.Controller
-
addModelObserver
public void addModelObserver(ca.uqam.info.max.skyjo.controller.ModelObserver observer) - Specified by:
addModelObserverin interfaceca.uqam.info.max.skyjo.controller.Controller
-
getCurrentPlayerCommands
public ca.uqam.info.max.skyjo.controller.Command[] getCurrentPlayerCommands()- Specified by:
getCurrentPlayerCommandsin interfaceca.uqam.info.max.skyjo.controller.Controller
-
doCommand
public void doCommand(int i) - Specified by:
doCommandin interfaceca.uqam.info.max.skyjo.controller.Controller
-
isUndoAvailable
public boolean isUndoAvailable()- Specified by:
isUndoAvailablein interfaceca.uqam.info.max.skyjo.controller.Controller
-
undoLastCommand
public void undoLastCommand()- Specified by:
undoLastCommandin interfaceca.uqam.info.max.skyjo.controller.Controller
-