-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathResultView.java
More file actions
35 lines (28 loc) · 989 Bytes
/
ResultView.java
File metadata and controls
35 lines (28 loc) · 989 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
package view;
import model.domain.RacingGame;
import java.util.List;
import java.util.stream.Collectors;
public class ResultView {
// private static final String RESULT = "실행 결과";
// private static final String WINNER = "최종 우승자 : ";
private static final String RESULT = "result";
private static final String WINNER = "winner : ";
public static void result(List<RacingGame> carlist) {
System.out.println(RESULT);
for (RacingGame cars : carlist) {
System.out.printf("%s : ", cars.getCarName());
printPos(cars);
}
System.out.println();
}
private static void printPos(RacingGame Car){
for(int i = 0; i < Car.getPos(); i++){
System.out.printf("-");
}
System.out.println();
}
public static void printWinner(List<String>str){
System.out.println(WINNER);
System.out.println(str.stream().collect(Collectors.joining(", ")));
}
}