-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathPathController.java
More file actions
30 lines (25 loc) · 894 Bytes
/
Copy pathPathController.java
File metadata and controls
30 lines (25 loc) · 894 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
package subway.controller;
import subway.view.InputView;
import subway.view.OutputView;
import subway.view.resource.PathFunction;
import subway.view.resource.Screen;
import java.util.Scanner;
public class PathController {
private PathController() {
}
public static void run(Scanner scanner) {
OutputView.loadView(Screen.PATH);
callFunction(InputView.getInputFunctionCode(scanner, Screen.PATH), scanner);
}
private static void callFunction(String functionCode, Scanner scanner) {
if (functionCode.equals(PathFunction.SHORTEST_PATH)) {
ShortestPathController.run(scanner);
}
if (functionCode.equals(PathFunction.MINIMUM_TIME)) {
MinimumTimePathController.run(scanner);
}
if (functionCode.equals(PathFunction.BACK)) {
ScreenController.run(Screen.MAIN, scanner);
}
}
}