Interface Game

All Known Implementing Classes:
BoardGame, LadderBoardGame, LudoBoardGame

public interface Game
Game interface

Interface defining common operations for all board games.

  • Method Details

    • initializeGame

      void initializeGame()
      Initializes the game with the given players.
    • getBoard

      Board getBoard()
      Gets the game board.
      Returns:
      the game board
    • getRoundNumber

      int getRoundNumber()
      Gets the current round number.
      Returns:
      the current round number
    • getPlayers

      List<Player> getPlayers()
      Gets all players in the game.
      Returns:
      list of all players
    • getCurrentPlayer

      Player getCurrentPlayer()
      Gets the current player.
      Returns:
      the current player
    • getDice

      Dice getDice()
      Gets the game dice.
      Returns:
      the game dice
    • setBoard

      void setBoard(Board board)
      Sets the game board.
      Parameters:
      board - the game board
    • setPlayers

      void setPlayers(List<Player> players)
      Sets the game players.
      Parameters:
      players - the game players
    • setCurrentPlayer

      void setCurrentPlayer(Player player)
      Sets the current player.
      Parameters:
      player - the current player
    • getWinner

      Player getWinner()
      Checks if the game has a winner.
      Returns:
      the player that has won the game, or null if there is no winner
    • handleRoundNumber

      void handleRoundNumber()
      Handles the round number.