Class ModelFactoryImpl

java.lang.Object
ca.uqam.info.student.skyjo.controller.ModelFactoryImpl
All Implemented Interfaces:
ca.uqam.info.max.skyjo.controller.ModelFactory

public class ModelFactoryImpl extends Object implements ca.uqam.info.max.skyjo.controller.ModelFactory
Implementation of the ModelFactory interface. This class provides instances of the application's model. It encapsulates the instantiation to ensure a cnetralized way of creating model objects.
  • Constructor Details

    • ModelFactoryImpl

      public ModelFactoryImpl()
      Default constructor.
  • Method Details

    • createModel

      public ca.uqam.info.max.skyjo.model.SkyjoModel createModel(ca.uqam.info.max.skyjo.controller.ModelPreset modelPreset, String[] strings, Random random)
      Creates and returns a new instance of the Skyjo model.
      Specified by:
      createModel in interface ca.uqam.info.max.skyjo.controller.ModelFactory
      Parameters:
      modelPreset - the preset configuration for the model (e.g. layout or rules)
      strings - the names of the players participating in the game
      random - a random generator used for shuffling or randomness
      Returns:
      a new instance of SkyjoModelImpl.