-
Notifications
You must be signed in to change notification settings - Fork 273
Expand file tree
/
Copy pathApplication.java
More file actions
49 lines (44 loc) · 1.56 KB
/
Copy pathApplication.java
File metadata and controls
49 lines (44 loc) · 1.56 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
package subway;
import subway.controller.*;
import subway.init.InitData;
import subway.ui.*;
import java.util.Scanner;
public class Application {
private static final String MAIN_MENU_QUIT_VALUE = "Q";
private static final String MAIN_MENU_SELECT_STATION = "1";
private static final String MAIN_MENU_SELECT_LINE = "2";
private static final String MAIN_MENU_SELECT_SECTION = "3";
private static final String MAIN_MENU_SELECT_MAP = "4";
public static void main(String[] args) {
final Scanner scanner = new Scanner(System.in);
// TODO: 프로그램 구현
InitData.startInitWork();
while(true) {
MainUI.printScreen();
String select = MainController.selectMenu(scanner);
if(select.equals(MAIN_MENU_QUIT_VALUE)) {
MainUI.printQuit();
break;
}
executeMenu(select, scanner);
}
}
private static void executeMenu(String select, Scanner scanner) {
if(select.equals(MAIN_MENU_SELECT_STATION)) {
StationUI.printScreen();
StationController.selectMenu(scanner);
}
if(select.equals(MAIN_MENU_SELECT_LINE)) {
LineUI.printScreen();
LineController.selectMenu(scanner);
}
if(select.equals(MAIN_MENU_SELECT_SECTION)) {
SectionUI.printScreen();
SectionController.selectMenu(scanner);
}
if(select.equals(MAIN_MENU_SELECT_MAP)) {
MapUI.printScreen();
MapController.selectMenu(scanner);
}
}
}