-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathLottoController.java
More file actions
50 lines (41 loc) · 1.84 KB
/
Copy pathLottoController.java
File metadata and controls
50 lines (41 loc) · 1.84 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
50
package lotto.controller;
import lotto.model.Lotto;
import lotto.model.LottoNumberMaker;
import lotto.model.LottoPercentageCalculation;
import lotto.model.constants.LottoPrize;
import lotto.view.LottoInput;
import lotto.view.LottoOutput;
import java.util.ArrayList;
import java.util.List;
import static java.util.Arrays.asList;
import static lotto.model.constants.LottoPrize.*;
public class LottoController {
private static final LottoNumberMaker lottoNumberMaker = new LottoNumberMaker();
private static final LottoInput lottoInput = new LottoInput();
private static final LottoOutput lottoOutput = new LottoOutput();
private static final LottoPercentageCalculation lottoPercentageCalculation = new LottoPercentageCalculation();
public static void setPrice() {
lottoNumberMaker.checkInt();
}
// static List<LottoPrize> LottoPrizelist= asList(FIFTH_PRIZE,FOURTH_PRIZE,THIRD_PRIZE,SECOND_PRIZE,FIRST_PRIZE);
public static void setBuyLottoNumberPrint() {
lottoOutput.buyLottoNumberPrint(lottoNumberMaker.getLottoNumber());
}
public static void setPrizeNumberInput() {
Lotto lotto = new Lotto(lottoInput.prizeNumberInput());
lotto.checkSame(lottoInput.bonusNumberInput(),lottoNumberMaker.getLottoNumber());
}
public static void winningStatistic() {
List<String> lottoPrizes = new ArrayList<>();
for(LottoPrize lottoPrize: LottoPrize.values()){
lottoPrizes.add(lottoPrize.getText()+lottoPrize.getWinCount()+lottoPrize.getUnit());
}
LottoOutput.seeWinningStatstic(lottoPrizes);
}
public static void PerformanceCalculation() {
lottoOutput.seePercentage(lottoPercentageCalculation.percentageCalculation(LottoPrize.values(),lottoNumberMaker.getBuyPrice()));
}
public String askPrice() {
return lottoInput.askPrice();
}
}