-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathMainController.java
More file actions
37 lines (28 loc) · 914 Bytes
/
Copy pathMainController.java
File metadata and controls
37 lines (28 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package subway.controller;
import subway.view.InputView;
import subway.view.OutputView;
import java.util.Arrays;
import java.util.List;
public class MainController {
private final InputView inputView;
private final PathController pathController;
public MainController(InputView inputView) {
this.inputView = inputView;
pathController = new PathController(inputView);
}
private final List<String> buttons = Arrays.asList(
MainButton.INQUIRY.getSymbol(),
MainButton.EXIT.getSymbol()
);
public void run() {
OutputView.printMain();
String selectedButton = inputView.getFunctionSelect(buttons);
nextProcedure(selectedButton);
}
private void nextProcedure(final String button) {
if (button.equals(MainButton.INQUIRY.getSymbol())) {
pathController.run();
run();
}
}
}