mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-04 09:11:39 +00:00
App field glidedRose by default
This commit is contained in:
parent
32edb8321c
commit
cc7bbb5b6e
@ -1,6 +1,8 @@
|
||||
package com.gildedrose
|
||||
|
||||
class App(private val glidedRose: GildedRose) {
|
||||
import com.gildedrose.data.constants.ItemRepository
|
||||
|
||||
class App(private val glidedRose: GildedRose = GildedRose(ItemRepository.items)) {
|
||||
fun printGlideRoseTable(days: Int) {
|
||||
welcomeMessage()
|
||||
repeat(days) { day ->
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
package com.gildedrose
|
||||
|
||||
import com.gildedrose.data.constants.ItemRepository
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
val app = App(GildedRose(ItemRepository.items))
|
||||
val app = App()
|
||||
|
||||
val days = when {
|
||||
args.isNotEmpty() -> Integer.parseInt(args[0]) + 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user