Package com.edu.xmum.CST210.Factory
Class GameModelFactory
java.lang.Object
com.edu.xmum.CST210.Factory.AbstractFactory
com.edu.xmum.CST210.Factory.GameModelFactory
GameModelFactory is responsible for creating instances of game models, player models, and maze models.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGameModel(Skin playerModel) Creates and returns an instance of IGameModel based on the specified skin.getMazeModel(String maze) Creates and returns an instance of IMazeModel based on the specified maze type.getPlayerModel(String player, IMazeModel mazeModel) Creates and returns an instance of IPlayerModel based on the specified player type and maze model.Methods inherited from class com.edu.xmum.CST210.Factory.AbstractFactory
getAiService, getGameController, getGameService, getMazeService, getMazeView, getPlayerService, getPlayerView, getPrepareView, getRunView, getSelectionView, getVictoryView, getWelcomeView
-
Constructor Details
-
GameModelFactory
public GameModelFactory()
-
-
Method Details
-
getGameModel
Creates and returns an instance of IGameModel based on the specified skin.- Overrides:
getGameModelin classAbstractFactory- Parameters:
playerModel- The skin enumeration that determines which game model to create.- Returns:
- An instance of IGameModel.
-
getPlayerModel
Creates and returns an instance of IPlayerModel based on the specified player type and maze model.- Overrides:
getPlayerModelin classAbstractFactory- Parameters:
player- The type of player ("Player" or "AI").mazeModel- The maze model associated with the player.- Returns:
- An instance of IPlayerModel.
-
getMazeModel
Creates and returns an instance of IMazeModel based on the specified maze type.- Overrides:
getMazeModelin classAbstractFactory- Parameters:
maze- The type of maze.- Returns:
- An instance of IMazeModel.
-