|
| 1 | +package lotto.view; |
| 2 | + |
| 3 | +import camp.nextstep.edu.missionutils.Console; |
| 4 | +import java.util.List; |
| 5 | +import java.util.stream.IntStream; |
| 6 | +import lotto.util.GamePrize; |
| 7 | +import lotto.util.SystemMessage; |
| 8 | + |
| 9 | +public class LottoView { |
| 10 | + |
| 11 | + public String inputPurchaseMoney() { |
| 12 | + System.out.println(SystemMessage.START_MONEY_GUIDE.getMessage()); |
| 13 | + return Console.readLine(); |
| 14 | + } |
| 15 | + |
| 16 | + public String inputJackpotNumber() { |
| 17 | + System.out.println(SystemMessage.START_TARGETLIST_GUIDE.getMessage()); |
| 18 | + return Console.readLine(); |
| 19 | + } |
| 20 | + |
| 21 | + public String inputBonusNumber() { |
| 22 | + System.out.println(SystemMessage.START_BONUS_GUIDE.getMessage()); |
| 23 | + return Console.readLine(); |
| 24 | + } |
| 25 | + |
| 26 | + public void outputPurchasedLottoNum(int lottoNum) { |
| 27 | + System.out.println(String.format(SystemMessage.RESULT_MONEY_GUIDE.getMessage(), lottoNum)); |
| 28 | + } |
| 29 | + |
| 30 | + public void outputPurchasedLottoDetail(List<Integer> lotto) { |
| 31 | + System.out.println(lotto); |
| 32 | + } |
| 33 | + |
| 34 | + public void outputLottoResult(int[] resultList, float profitPercent) { |
| 35 | + GamePrize[] prizes = GamePrize.values(); |
| 36 | + System.out.println(SystemMessage.RESULT_JACKPOT_GUIDE.getMessage()); |
| 37 | + IntStream.range(0, prizes.length) |
| 38 | + .forEach(i -> System.out.println(prizes[i].getMessage() + resultList[i] + "개")); |
| 39 | + System.out.println(String.format(SystemMessage.RESULT_PROFIT_GUIDE.getMessage(), profitPercent)); |
| 40 | + } |
| 41 | +} |
0 commit comments