Class GameSettings

java.lang.Object
net.royalur.model.GameSettings

public class GameSettings extends Object
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 Details

    • FINKEL

      public static final GameSettings FINKEL
      The rules used in the YouTube video Tom Scott vs. Irving Finkel.
    • OLD_MASTERS

      public static final GameSettings OLD_MASTERS
      The settings proposed by James Masters.
    • MASTERS

      public static final GameSettings MASTERS
      The settings proposed by James Masters.
    • ASEB

      public static final GameSettings ASEB
      The settings used for Aseb.
    • BLITZ

      public static final GameSettings 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

      public BoardShape getBoardShape()
      Gets the shape of the game board.
      Returns:
      The shape of the game board.
    • getPaths

      public PathPair getPaths()
      Gets the paths that each player must take around the board.
      Returns:
      The paths that each player must take around the board.
    • getDice

      public DiceFactory 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

      public GameSettings withBoardShape(BoardShape boardShape)
      Generates new game settings with boardShape.
      Parameters:
      boardShape - The board shape to use for the new game settings.
      Returns:
      New game settings updated with a new board shape.
    • withBoardShape

      public GameSettings withBoardShape(BoardShapeFactory boardShapeFactory)
      Generates new game settings with a board shape from boardShapeFactory.
      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

      public GameSettings withPaths(PathPair paths)
      Generates new game settings with paths.
      Parameters:
      paths - The paths to use for the new game settings.
      Returns:
      New game settings updated with new paths.
    • withPaths

      public GameSettings withPaths(PathPairFactory pathsFactory)
      Generates new game settings with paths generated by pathsFactory.
      Parameters:
      pathsFactory - The factory to use to generate the paths for the new game settings.
      Returns:
      New game settings updated with new paths.
    • withDice

      public GameSettings withDice(DiceFactory diceFactory)
      Generates new game settings with diceFactory.
      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

      public GameSettings withStartingPieceCount(int startingPieceCount)
      Generates new game settings with startingPieceCount.
      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

      public GameSettings withSafeRosettes(boolean safeRosettes)
      Generates new game settings with safeRosettes.
      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

      public GameSettings withRosettesGrantExtraRolls(boolean rosettesGrantExtraRolls)
      Generates new game settings with rosettesGrantExtraRolls.
      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

      public GameSettings withCapturesGrantExtraRolls(boolean capturesGrantExtraRolls)
      Generates new game settings with capturesGrantExtraRolls.
      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

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object