Interface BoardFactory

All Known Implementing Classes:
LadderBoardFactory, LudoBoardFactory

public interface BoardFactory
BoardFactory Interface.

Defines the necessary methods for factories that create game boards.

Implementations of this interface are responsible for instantiating different types of boards.

  • Method Summary

    Modifier and Type
    Method
    Description
    createBlankBoard(int rows, int columns)
    Creates a blank game board with the specified number of rows and columns.
    Creates a game board of a specific variant.
    Creates a game board by loading its configuration from a file.
  • Method Details

    • createBoard

      Board createBoard(String variant)
      Creates a game board of a specific variant.
      Parameters:
      variant - A string identifier for the board variant.
      Returns:
      The created Board instance.
    • createBoardFromFile

      Board createBoardFromFile(String filePath)
      Creates a game board by loading its configuration from a file.
      Parameters:
      filePath - The path to the file containing the board data.
      Returns:
      The created Board instance.
    • createBlankBoard

      Board createBlankBoard(int rows, int columns)
      Creates a blank game board with the specified number of rows and columns.
      Parameters:
      rows - The number of rows for the board.
      columns - The number of columns for the board.
      Returns:
      The created Board instance.