mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 07:51:29 +00:00
Invert agedbrie and backstage conditional
This commit is contained in:
parent
481a303bae
commit
7c81b6d242
@ -19,13 +19,7 @@ export class GildedRose {
|
|||||||
|
|
||||||
updateQuality() {
|
updateQuality() {
|
||||||
this.items.forEach((item, i) => {
|
this.items.forEach((item, i) => {
|
||||||
if (item.name != 'Aged Brie' && item.name != 'Backstage passes to a TAFKAL80ETC concert') {
|
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.quality < 50) {
|
if (item.quality < 50) {
|
||||||
item.quality = item.quality + 1
|
item.quality = item.quality + 1
|
||||||
if (item.name == 'Backstage passes to a TAFKAL80ETC concert') {
|
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') {
|
if (item.name != 'Sulfuras, Hand of Ragnaros') {
|
||||||
item.sellIn = item.sellIn - 1;
|
item.sellIn = item.sellIn - 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user