Class GameServiceFactory

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

public class GameServiceFactory extends AbstractFactory
GameServiceFactory is responsible for creating instances of game services, player services, AI services, and maze services.
  • Constructor Details

    • GameServiceFactory

      public GameServiceFactory()
  • Method Details

    • getGameService

      public IGameService getGameService(Skin gameService, IGameModel gameModel)
      Creates and returns an instance of IGameService based on the specified skin.
      Overrides:
      getGameService in class AbstractFactory
      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:
      getPlayerService in class AbstractFactory
      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:
      getAiService in class AbstractFactory
      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

      public IMazeService getMazeService(String vision, IMazeModel mazeModel)
      Creates and returns an instance of IMazeService based on the specified vision and maze model.
      Overrides:
      getMazeService in class AbstractFactory
      Parameters:
      vision - The type of maze service ("Maze").
      mazeModel - The maze model associated with the maze service.
      Returns:
      An instance of IMazeService.