Skip to content

Commit 084c1a5

Browse files
committed
refactor: GameFactory 메서드 분리
1 parent 3b09d52 commit 084c1a5

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/main/java/com/kakao/onboarding/precource/dukeyun/baseball/GameFactory.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ public class GameFactory {
1414
private GameFactory() {
1515
}
1616

17+
public static BaseballGameConfig baseballGameConfig() {
18+
return new BaseballGameConfig(3, 1, 9);
19+
}
20+
1721
public static GameSystem createBaseballGameSystem() {
18-
return createBaseballGameSystem(new BaseballGameConfig(3, 1, 9));
22+
return createBaseballGameSystem(baseballGameConfig());
1923
}
2024

2125
public static GameSystem createBaseballGameSystem(BaseballGameConfig config) {
22-
return new ReplayableGameSystem(
23-
new ReplayableGameSystemConsoleView(),
24-
createBaseBallGame(config)
25-
);
26+
return new ReplayableGameSystem(new ReplayableGameSystemConsoleView(), createBaseballGame(config));
2627
}
2728

28-
private static Game createBaseBallGame(BaseballGameConfig config) {
29+
private static Game createBaseballGame(BaseballGameConfig config) {
2930
return new TurnBaseGame(
3031
new BaseballGameConsoleView(config),
3132
new BaseballGameService(config, new RandomBaseballNumberGenerator(config))

0 commit comments

Comments
 (0)