-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathApplication.java
More file actions
47 lines (39 loc) · 2.11 KB
/
Copy pathApplication.java
File metadata and controls
47 lines (39 loc) · 2.11 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
package subway;
import subway.domain.*;
import subway.view.MainView;
import java.util.Scanner;
public class Application {
public static void main(String[] args) {
final Scanner scanner = new Scanner(System.in);
init();
MainView mainView = new MainView(scanner);
mainView.startView();
}
public static void init() {
StationRepository.addStation(new Station("교대역"));
StationRepository.addStation(new Station("강남역"));
StationRepository.addStation(new Station("역삼역"));
StationRepository.addStation(new Station("남부터미널역"));
StationRepository.addStation(new Station("양재역"));
StationRepository.addStation(new Station("양재시민의숲역"));
StationRepository.addStation(new Station("매봉역"));
LineRepository.addLine(new Line("2호선", StationRepository.getStationByName("교대역"),
StationRepository.getStationByName("역삼역"), new Path(2, 3)));
Line lineSecond = LineRepository.getLineByName("2호선");
lineSecond.addStation(StationRepository.getStationByName("강남역"), 2);
lineSecond.addPath(new Path(2,3), 2);
LineRepository.addLine(new Line("3호선", StationRepository.getStationByName("교대역"),
StationRepository.getStationByName("매봉역"), new Path(3, 2)));
Line lineThird = LineRepository.getLineByName("3호선");
lineThird.addStation(StationRepository.getStationByName("남부터미널역"), 2);
lineThird.addPath(new Path(6,5), 2);
lineThird.addStation(StationRepository.getStationByName("양재역"), 3);
lineThird.addPath(new Path(1,1), 3);
LineRepository.addLine(new Line("신분당선", StationRepository.getStationByName("강남역"),
StationRepository.getStationByName("양재시민의숲역"), new Path(2, 8)));
Line lineNew = LineRepository.getLineByName("신분당선");
lineNew.addStation(StationRepository.getStationByName("양재역"), 2);
lineNew.addPath(new Path(2,8), 2);
RouteRepository.init();
}
}