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