Package net.royalur.model
Class GameSettings
java.lang.Object
net.royalur.model.GameSettings
Settings for running games of the Royal Game of Ur. This is built for
convenience, and cannot represent all possible combinations of rules
that can be used to play the Royal Game of Ur. If a more exotic set of
rules is desired, then you will need to construct your games manually.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final GameSettings
The settings used for Aseb.static final GameSettings
The settings used for Blitz.static final GameSettings
The rules used in the YouTube video Tom Scott vs.static final GameSettings
The settings proposed by James Masters.static final GameSettings
The settings proposed by James Masters. -
Constructor Summary
ConstructorDescriptionGameSettings
(BoardShape boardShape, PathPair paths, DiceFactory diceFactory, int startingPieceCount, boolean safeRosettes, boolean rosettesGrantExtraRolls, boolean capturesGrantExtraRolls) Instantiates a new set of game settings for the Royal Game of Ur. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets whether pieces on rosette tiles are safe from capture.boolean
Gets whether capturing a piece grants the player an additional roll of the dice.boolean
Gets whether landing on a rosette tile grants the player an additional roll of the dice.boolean
Gets the shape of the game board.getDice()
Gets the generator of the dice that should be used to generate dice rolls.getPaths()
Gets the paths that each player must take around the board.int
Gets the number of pieces that each player starts with.withBoardShape
(BoardShape boardShape) Generates new game settings withboardShape
.withBoardShape
(BoardShapeFactory boardShapeFactory) Generates new game settings with a board shape fromboardShapeFactory
.withCapturesGrantExtraRolls
(boolean capturesGrantExtraRolls) Generates new game settings withcapturesGrantExtraRolls
.withDice
(DiceFactory diceFactory) Generates new game settings withdiceFactory
.Generates new game settings withpaths
.withPaths
(PathPairFactory pathsFactory) Generates new game settings with paths generated bypathsFactory
.withRosettesGrantExtraRolls
(boolean rosettesGrantExtraRolls) Generates new game settings withrosettesGrantExtraRolls
.withSafeRosettes
(boolean safeRosettes) Generates new game settings withsafeRosettes
.withStartingPieceCount
(int startingPieceCount) Generates new game settings withstartingPieceCount
.
-
Field Details
-
FINKEL
The rules used in the YouTube video Tom Scott vs. Irving Finkel. -
OLD_MASTERS
The settings proposed by James Masters. -
MASTERS
The settings proposed by James Masters. -
ASEB
The settings used for Aseb. -
BLITZ
The settings used for Blitz.
-
-
Constructor Details
-
GameSettings
public GameSettings(BoardShape boardShape, PathPair paths, DiceFactory diceFactory, int startingPieceCount, boolean safeRosettes, boolean rosettesGrantExtraRolls, boolean capturesGrantExtraRolls) Instantiates a new set of game settings for the Royal Game of Ur.- Parameters:
boardShape
- The shape of the game board.paths
- The paths that each player must take around the board.diceFactory
- A generator for the dice that should be used to generate dice rolls.startingPieceCount
- The number of pieces that each player starts with.safeRosettes
- Whether pieces on rosette tiles are safe from capture.rosettesGrantExtraRolls
- Whether landing on a rosette grants an extra roll.capturesGrantExtraRolls
- Whether capturing a piece grants an extra roll.
-
-
Method Details
-
getBoardShape
Gets the shape of the game board.- Returns:
- The shape of the game board.
-
getPaths
Gets the paths that each player must take around the board.- Returns:
- The paths that each player must take around the board.
-
getDice
Gets the generator of the dice that should be used to generate dice rolls.- Returns:
- The generator of the dice that should be used to generate dice rolls.
-
getStartingPieceCount
public int getStartingPieceCount()Gets the number of pieces that each player starts with.- Returns:
- The number of pieces that each player starts with.
-
areRosettesSafe
public boolean areRosettesSafe()Gets whether pieces on rosette tiles are safe from capture.- Returns:
- Whether pieces on rosette tiles are safe from capture.
-
doRosettesGrantExtraRolls
public boolean doRosettesGrantExtraRolls()Gets whether landing on a rosette tile grants the player an additional roll of the dice.- Returns:
- Whether landing on a rosette grants an extra roll.
-
doCapturesGrantExtraRolls
public boolean doCapturesGrantExtraRolls()Gets whether capturing a piece grants the player an additional roll of the dice.- Returns:
- Whether capturing a piece grants an extra roll.
-
withBoardShape
Generates new game settings withboardShape
.- Parameters:
boardShape
- The board shape to use for the new game settings.- Returns:
- New game settings updated with a new board shape.
-
withBoardShape
Generates new game settings with a board shape fromboardShapeFactory
.- Parameters:
boardShapeFactory
- The factory to use to generate the board shape for the new game settings.- Returns:
- New game settings updated with a new board shape.
-
withPaths
Generates new game settings withpaths
.- Parameters:
paths
- The paths to use for the new game settings.- Returns:
- New game settings updated with new paths.
-
withPaths
Generates new game settings with paths generated bypathsFactory
.- Parameters:
pathsFactory
- The factory to use to generate the paths for the new game settings.- Returns:
- New game settings updated with new paths.
-
withDice
Generates new game settings withdiceFactory
.- Parameters:
diceFactory
- The factory to use to generate dice for games made using the new game settings.- Returns:
- New game settings updated with a new generator of dice.
-
withStartingPieceCount
Generates new game settings withstartingPieceCount
.- Parameters:
startingPieceCount
- The number of pieces for each player to start with in the new game settings.- Returns:
- New game settings updated with a new starting piece count.
-
withSafeRosettes
Generates new game settings withsafeRosettes
.- Parameters:
safeRosettes
- Whether rosettes should be safe from capture in the new game settings.- Returns:
- New game settings updated with a new value for whether rosettes are safe.
-
withRosettesGrantExtraRolls
Generates new game settings withrosettesGrantExtraRolls
.- Parameters:
rosettesGrantExtraRolls
- Whether landing on a rosette should grant an extra roll in the new game settings.- Returns:
- New game settings updated with a new value for whether landing on rosettes grants an extra roll.
-
withCapturesGrantExtraRolls
Generates new game settings withcapturesGrantExtraRolls
.- Parameters:
capturesGrantExtraRolls
- Whether capturing a piece should grant an extra roll in the new game settings.- Returns:
- New game settings updated with a new value for whether capturing a piece grants an extra roll.
-
equals
-