Skip to content

Commit

Permalink
refactor(InputView): 가이드 메세지 상수화
Browse files Browse the repository at this point in the history
  • Loading branch information
minseok0416 committed Nov 4, 2024
1 parent 1c591ee commit 2a6b544
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/main/kotlin/lotto/InputView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,31 @@ import camp.nextstep.edu.missionutils.Console

class InputView {

fun inputLottoPurchaseAmount(): String {
println("구입금액을 입력해 주세요.")
fun inputPurchaseAmount(): String {
val guideMessage = GuideMessage.PurchaseAmount
guideMessage.printGuideMessage()
return Console.readLine()
}

fun inputLottoNumbers(): String {
println("당첨 번호를 입력해 주세요.")
val guideMessage = GuideMessage.LottoNumbers
guideMessage.printGuideMessage()
return Console.readLine()
}

fun inputBonusLottoNumber(): String {
println("보너스 번호를 입력해 주세요.")
fun inputBonusNumber(): String {
val guideMessage = GuideMessage.BonusNumber
guideMessage.printGuideMessage()
return Console.readLine()
}

enum class GuideMessage(private val message: String) {
PurchaseAmount("구입금액을 입력해 주세요."),
LottoNumbers("당첨 번호를 입력해 주세요."),
BonusNumber("보너스 번호를 입력해 주세요.");

fun printGuideMessage() {
println(message)
}
}
}

0 comments on commit 2a6b544

Please sign in to comment.