Class GameModelFactory

java.lang.Object
com.edu.xmum.CST210.Factory.AbstractFactory
com.edu.xmum.CST210.Factory.GameModelFactory

public class GameModelFactory extends AbstractFactory
GameModelFactory is responsible for creating instances of game models, player models, and maze models.
  • Constructor Details

    • GameModelFactory

      public GameModelFactory()
  • Method Details

    • getGameModel

      public IGameModel getGameModel(Skin playerModel)
      Creates and returns an instance of IGameModel based on the specified skin.
      Overrides:
      getGameModel in class AbstractFactory
      Parameters:
      playerModel - The skin enumeration that determines which game model to create.
      Returns:
      An instance of IGameModel.
    • getPlayerModel

      public IPlayerModel getPlayerModel(String player, IMazeModel mazeModel)
      Creates and returns an instance of IPlayerModel based on the specified player type and maze model.
      Overrides:
      getPlayerModel in class AbstractFactory
      Parameters:
      player - The type of player ("Player" or "AI").
      mazeModel - The maze model associated with the player.
      Returns:
      An instance of IPlayerModel.
    • getMazeModel

      public IMazeModel getMazeModel(String maze)
      Creates and returns an instance of IMazeModel based on the specified maze type.
      Overrides:
      getMazeModel in class AbstractFactory
      Parameters:
      maze - The type of maze.
      Returns:
      An instance of IMazeModel.