Package net.royalur
Class GameBuilder
java.lang.Object
net.royalur.GameBuilder
A builder to help in the creation of custom games of the Royal Game of Ur.
-
Constructor Summary
ConstructorDescriptionGameBuilder
(GameSettings settings, RuleSetProvider ruleSetProvider) Instantiates a new game builder. -
Method Summary
Modifier and TypeMethodDescriptionaseb()
Creates a new builder that allows the construction of games following the Aseb rules.boardShape
(BoardShape boardShape) Copies this game builder with the shape of the board set toboardShape
.boardShape
(BoardType boardType) Copies this game builder with the shape of the board set toboardType
.build()
Generates a new game using the rules set in this builder.Generates a rule set to match the settings in this builder.capturesGrantExtraRolls
(boolean capturesGrantExtraRolls) Copies this game builder with capturing pieces granting extra dice rolls ifcapturesGrantExtraRolls
is true.dice
(DiceFactory diceFactory) Copies this game builder with the factory used to generate dice for games set todiceFactory
.finkel()
Creates a new builder that allows the construction of games following the simple rules proposed by Irving Finkel.Gets the provider to use to construct the final rule set.Get the settings of the game being built.masters()
Creates a new builder that allows the construction of games following the rules proposed by James Masters.Copies this game builder with the paths taken by each player set topaths
.Copies this game builder with the paths taken by each player set topathType
.replaceSettings
(GameSettings settings) Create a copy of this game builder with new settings.rosettesGrantExtraRolls
(boolean rosettesGrantExtraRolls) Copies this game builder with rosettes granting extra dice rolls ifrosettesGrantExtraRolls
is true.safeRosettes
(boolean safeRosettes) Copies this game builder with whether rosettes are safe from capture set tosafeRosettes
.startingPieceCount
(int startingPieceCount) Copies this game builder with the number of starting pieces of each player set tostartingPieceCount
.
-
Constructor Details
-
GameBuilder
Instantiates a new game builder.- Parameters:
settings
- The settings of the game being built.ruleSetProvider
- The provider to use to construct the final rule set.
-
-
Method Details
-
getSettings
Get the settings of the game being built.- Returns:
- The settings of the game being built.
-
getRuleSetProvider
Gets the provider to use to construct the final rule set.- Returns:
- The provider to use to construct the final rule set.
-
replaceSettings
Create a copy of this game builder with new settings.- Parameters:
settings
- The new settings.- Returns:
- A copy of this game builder with new settings.
-
finkel
Creates a new builder that allows the construction of games following the simple rules proposed by Irving Finkel.- Returns:
- A new builder that allows the construction of games following the rules proposed by Irving Finkel.
-
masters
Creates a new builder that allows the construction of games following the rules proposed by James Masters.- Returns:
- A new builder that allows the construction of games following the rules proposed James Masters.
-
aseb
Creates a new builder that allows the construction of games following the Aseb rules.- Returns:
- A new builder that allows the construction of games following the Aseb rules.
-
boardShape
Copies this game builder with the shape of the board set toboardType
.- Parameters:
boardType
- The type of board shape to use for generated games.- Returns:
- A copy of this game builder with the shape of the board set
to
boardType
.
-
boardShape
Copies this game builder with the shape of the board set toboardShape
.- Parameters:
boardShape
- The shape of the board to use for generated games.- Returns:
- A copy of this game builder with the shape of the board set
to
boardShape
.
-
paths
Copies this game builder with the paths taken by each player set topathType
.- Parameters:
pathType
- The type of paths to be taken by each player.- Returns:
- A copy of this game builder with the paths taken by each
player set to
pathType
.
-
paths
Copies this game builder with the paths taken by each player set topaths
.- Parameters:
paths
- The paths to be taken by each player.- Returns:
- A copy of this game builder with the paths taken by each
player set to
paths
.
-
dice
Copies this game builder with the factory used to generate dice for games set todiceFactory
.- Parameters:
diceFactory
- The factory to use to generate dice for games.- Returns:
- A copy of this game builder with factory used to generate
dice for games set to
diceFactory
.
-
startingPieceCount
Copies this game builder with the number of starting pieces of each player set tostartingPieceCount
.- Parameters:
startingPieceCount
- The number of pieces that each player starts with in the game.- Returns:
- A copy of this game builder with the number of starting pieces
of each player set to
startingPieceCount
.
-
safeRosettes
Copies this game builder with whether rosettes are safe from capture set tosafeRosettes
.- Parameters:
safeRosettes
- Whether rosette tiles are safe squares for pieces.- Returns:
- A copy of this game builder with safe rosettes if
safeRosettes
is true, or else with unsafe rosettes.
-
rosettesGrantExtraRolls
Copies this game builder with rosettes granting extra dice rolls ifrosettesGrantExtraRolls
is true.- Parameters:
rosettesGrantExtraRolls
- Whether landing on a rosette grants an extra roll.- Returns:
- A copy of this game builder with rosettes granting extra
dice rolls set to
rosettesGrantExtraRolls
.
-
capturesGrantExtraRolls
Copies this game builder with capturing pieces granting extra dice rolls ifcapturesGrantExtraRolls
is true.- Parameters:
capturesGrantExtraRolls
- Whether capturing a piece grants an extra roll.- Returns:
- A copy of this game builder with capturing pieces granting
extra dice rolls set to
capturesGrantExtraRolls
.
-
buildRules
Generates a rule set to match the settings in this builder.- Returns:
- A rule set to match the settings in this builder.
-
build
Generates a new game using the rules set in this builder.- Returns:
- A new game using the rules set in this builder.
-