Package com.edu.xmum.CST210.Factory
Class GameServiceFactory
java.lang.Object
com.edu.xmum.CST210.Factory.AbstractFactory
com.edu.xmum.CST210.Factory.GameServiceFactory
GameServiceFactory is responsible for creating instances of game services, player services, AI services, and maze services.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAiService(String vision, IMazeService mazeService, IPlayerModel playModel, IPlayerModel aiModel) Creates and returns an instance of IAiService based on the specified vision, maze service, player model, and AI model.getGameService(Skin gameService, IGameModel gameModel) Creates and returns an instance of IGameService based on the specified skin.getMazeService(String vision, IMazeModel mazeModel) Creates and returns an instance of IMazeService based on the specified vision and maze model.getPlayerService(String vision, IPlayerModel playerModel, IMazeService mazeService) Creates and returns an instance of IPlayerService based on the specified vision, player model, and maze service.Methods inherited from class com.edu.xmum.CST210.Factory.AbstractFactory
getGameController, getGameModel, getMazeModel, getMazeView, getPlayerModel, getPlayerView, getPrepareView, getRunView, getSelectionView, getVictoryView, getWelcomeView
-
Constructor Details
-
GameServiceFactory
public GameServiceFactory()
-
-
Method Details
-
getGameService
Creates and returns an instance of IGameService based on the specified skin.- Overrides:
getGameServicein classAbstractFactory- Parameters:
gameService- The skin enumeration that determines which game service to create.gameModel- The game model associated with the game service.- Returns:
- An instance of IGameService.
-
getPlayerService
public IPlayerService getPlayerService(String vision, IPlayerModel playerModel, IMazeService mazeService) Creates and returns an instance of IPlayerService based on the specified vision, player model, and maze service.- Overrides:
getPlayerServicein classAbstractFactory- Parameters:
vision- The type of player service ("Player").playerModel- The player model associated with the player service.mazeService- The maze service associated with the player service.- Returns:
- An instance of IPlayerService.
-
getAiService
public IAiService getAiService(String vision, IMazeService mazeService, IPlayerModel playModel, IPlayerModel aiModel) Creates and returns an instance of IAiService based on the specified vision, maze service, player model, and AI model.- Overrides:
getAiServicein classAbstractFactory- Parameters:
vision- The type of AI service ("AI").mazeService- The maze service associated with the AI service.playModel- The player model associated with the AI service.aiModel- The AI model associated with the AI service.- Returns:
- An instance of IAiService.
-
getMazeService
Creates and returns an instance of IMazeService based on the specified vision and maze model.- Overrides:
getMazeServicein classAbstractFactory- Parameters:
vision- The type of maze service ("Maze").mazeModel- The maze model associated with the maze service.- Returns:
- An instance of IMazeService.
-