-
Notifications
You must be signed in to change notification settings - Fork 359
Expand file tree
/
Copy pathLottoMachine.kt
More file actions
31 lines (27 loc) · 1.03 KB
/
LottoMachine.kt
File metadata and controls
31 lines (27 loc) · 1.03 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
package lotto
import lotto.model.process.MachineProcess
import lotto.view.keyboard.Keyboard
import lotto.view.monitor.Monitor
class LottoMachine(
private val process: MachineProcess,
private val keyboard: Keyboard,
private val monitor: Monitor,
) : Machine {
override fun issuanceLottoNumber() {
monitor.displayLottoPurchaseAmount()
val totalPurchaseAmount = keyboard.inputLottoPrice()
val lottoCount = process.calculateLottoCount(totalPurchaseAmount)
monitor.displayLottoPurchasesCount(lottoCount)
val lottoTickets = process.generateLottoTickets(lottoCount)
monitor.displayIssuedLottoTickets(lottoTickets)
monitor.displayInputLastWeekLottoWinningNumbers()
val lastWeekNumbers = keyboard.inputLastWeekWinningNumbers()
val lottoStatistics =
process.calculateWinningStatistics(
lottoTickets,
lastWeekNumbers,
totalPurchaseAmount,
)
monitor.displayLottoStatistics(lottoStatistics)
}
}