Package edu.ntnu.idi.idatt.model.game
Interface Game
- All Known Implementing Classes:
BoardGame
,LadderBoardGame
,LudoBoardGame
public interface Game
Game interface
Interface defining common operations for all board games.
-
Method Summary
Modifier and TypeMethodDescriptiongetBoard()
Gets the game board.Gets the current player.getDice()
Gets the game dice.Gets all players in the game.int
Gets the current round number.Checks if the game has a winner.void
Handles the round number.void
Initializes the game with the given players.void
Sets the game board.void
setCurrentPlayer
(Player player) Sets the current player.void
setPlayers
(List<Player> players) Sets the game players.
-
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
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
Sets the game board.- Parameters:
board
- the game board
-
setPlayers
Sets the game players.- Parameters:
players
- the game players
-
setCurrentPlayer
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.
-