mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 07:51:29 +00:00
Continue lifting side effects
This commit is contained in:
parent
6e34829ee8
commit
651c14a38b
@ -32,11 +32,12 @@ export class GildedRose {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private updateItemQuality(item: Item): number {
|
private updateItemQuality(item: Item): number {
|
||||||
if (item.name === 'Sulfuras, Hand of Ragnaros') return item.quality
|
if (item.name === 'Sulfuras, Hand of Ragnaros') {
|
||||||
|
return item.quality
|
||||||
|
}
|
||||||
|
|
||||||
if (item.name == 'Aged Brie') {
|
if (item.name == 'Aged Brie') {
|
||||||
item.quality = this.incrementQuality(item);
|
return this.incrementQuality(item);
|
||||||
return item.quality
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.name == 'Backstage passes to a TAFKAL80ETC concert') {
|
if (item.name == 'Backstage passes to a TAFKAL80ETC concert') {
|
||||||
@ -47,8 +48,7 @@ export class GildedRose {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item.quality > 0) {
|
if (item.quality > 0) {
|
||||||
item.quality = item.quality - 1
|
return item.quality - 1
|
||||||
return item.quality
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return item.quality
|
return item.quality
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user