12
12
* @param gameCreator a function that can be called to create a game instance
13
13
*/
14
14
public record GameSdkConfig (int minPlayers , int maxGames , int minTrackingInterval , int maxTrackingInterval ,
15
- @ NotNull GameCreator gameCreator ) {
15
+ boolean lobbyOnFinish , @ NotNull GameCreator gameCreator ) {
16
16
17
17
public static @ NotNull Builder builder () {
18
18
return new BuilderImpl ();
@@ -33,6 +33,8 @@ interface GameCreatorStep {
33
33
34
34
@ NotNull GameCreatorStep maxTrackingInterval (int interval );
35
35
36
+ @ NotNull GameCreatorStep lobbyOnFinish (boolean lobbyOnFinish );
37
+
36
38
@ NotNull EndStep gameCreator (@ NotNull GameCreator creator );
37
39
}
38
40
@@ -48,6 +50,7 @@ private static final class BuilderImpl implements Builder, Builder.MaxGamesStep,
48
50
private int maxGames ;
49
51
private int minTrackingInterval = GameTracker .DEFAULT_MIN_UPDATE_INTERVAL ;
50
52
private int maxTrackingInterval = GameTracker .DEFAULT_MAX_UPDATE_INTERVAL ;
53
+ private boolean lobbyOnFinish = true ;
51
54
private GameCreator gameCreator ;
52
55
53
56
@ Override
@@ -74,6 +77,12 @@ private static final class BuilderImpl implements Builder, Builder.MaxGamesStep,
74
77
return this ;
75
78
}
76
79
80
+ @ Override
81
+ public @ NotNull GameCreatorStep lobbyOnFinish (boolean lobbyOnFinish ) {
82
+ this .lobbyOnFinish = lobbyOnFinish ;
83
+ return this ;
84
+ }
85
+
77
86
@ Override
78
87
public @ NotNull EndStep gameCreator (@ NotNull GameCreator creator ) {
79
88
this .gameCreator = creator ;
@@ -83,7 +92,7 @@ private static final class BuilderImpl implements Builder, Builder.MaxGamesStep,
83
92
@ Override
84
93
public @ NotNull GameSdkConfig build () {
85
94
return new GameSdkConfig (this .minPlayers , this .maxGames , this .minTrackingInterval , this .maxTrackingInterval ,
86
- this .gameCreator );
95
+ this .lobbyOnFinish , this . gameCreator );
87
96
}
88
97
}
89
98
}
0 commit comments