Package com.ohacd.matchbox.api
Class GameConfig.Builder
java.lang.Object
com.ohacd.matchbox.api.GameConfig.Builder
- Enclosing class:
GameConfig
Builder class for creating GameConfig instances.
Provides a fluent interface for building game configurations with validation and sensible defaults.
Example usage:
GameConfig config = new GameConfig.Builder()
.swipeDuration(120)
.discussionDuration(60)
.votingDuration(30)
.sparkAbility("hunter_vision")
.medicAbility("healing_sight")
.randomSkins(true)
.steveSkins(false)
.build();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the GameConfig instance.discussionDuration(int seconds) Sets the discussion phase duration.medicAbility(String ability) Sets the Medic secondary ability.randomSkins(boolean enabled) Sets whether random skins are enabled.sparkAbility(String ability) Sets the Spark secondary ability.steveSkins(boolean enabled) Sets whether Steve skins are forced.swipeDuration(int seconds) Sets the swipe phase duration.votingDuration(int seconds) Sets the voting phase duration.
-
Constructor Details
-
Builder
public Builder()Creates a new builder with default values.
-
-
Method Details
-
swipeDuration
Sets the swipe phase duration.- Parameters:
seconds- duration in seconds, must be positive- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if seconds is not positive
-
discussionDuration
Sets the discussion phase duration.- Parameters:
seconds- duration in seconds, must be positive- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if seconds is not positive
-
votingDuration
Sets the voting phase duration.- Parameters:
seconds- duration in seconds, must be positive- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if seconds is not positive
-
sparkAbility
Sets the Spark secondary ability.- Parameters:
ability- the ability to use ("random", "hunter_vision", "spark_swap", "delusion")- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if ability is invalid
-
medicAbility
Sets the Medic secondary ability.- Parameters:
ability- the ability to use ("random", "healing_sight")- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if ability is invalid
-
randomSkins
Sets whether random skins are enabled.- Parameters:
enabled- true to enable random skins- Returns:
- this builder instance for method chaining
-
steveSkins
Sets whether Steve skins are forced.- Parameters:
enabled- true to force Steve skins- Returns:
- this builder instance for method chaining
-
build
Builds the GameConfig instance.- Returns:
- the created configuration
-