diff --git a/TypeScript/app/gilded-rose.ts b/TypeScript/app/gilded-rose.ts index d7e41504..72ccdd01 100644 --- a/TypeScript/app/gilded-rose.ts +++ b/TypeScript/app/gilded-rose.ts @@ -19,13 +19,7 @@ export class GildedRose { updateQuality() { this.items.forEach((item, i) => { - if (item.name != 'Aged Brie' && item.name != 'Backstage passes to a TAFKAL80ETC concert') { - if (item.quality > 0) { - if (item.name != 'Sulfuras, Hand of Ragnaros') { - item.quality = item.quality - 1 - } - } - } else { + if (item.name == 'Aged Brie' || item.name == 'Backstage passes to a TAFKAL80ETC concert') { if (item.quality < 50) { item.quality = item.quality + 1 if (item.name == 'Backstage passes to a TAFKAL80ETC concert') { @@ -41,6 +35,12 @@ export class GildedRose { } } } + } else { + if (item.quality > 0) { + if (item.name != 'Sulfuras, Hand of Ragnaros') { + item.quality = item.quality - 1 + } + } } if (item.name != 'Sulfuras, Hand of Ragnaros') { item.sellIn = item.sellIn - 1;