update item quality

updating the ite.quality affectation
This commit is contained in:
Trobax 2022-11-23 16:41:27 +01:00
parent 112db7306b
commit 1302ae4686

View File

@ -13,23 +13,23 @@ class GildedRose {
&& !item.name.equals("Backstage passes to a TAFKAL80ETC concert")) { && !item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (item.quality > 0) { if (item.quality > 0) {
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) { if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
item.quality = item.quality - 1; item.quality--;
} }
} }
} else { } else {
if (item.quality < 50) { if (item.quality < 50) {
item.quality = item.quality + 1; item.quality++;
if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) { if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (item.sellIn < 11) { if (item.sellIn < 11) {
if (item.quality < 50) { if (item.quality < 50) {
item.quality = item.quality + 1; item.quality++;
} }
} }
if (item.sellIn < 6) { if (item.sellIn < 6) {
if (item.quality < 50) { if (item.quality < 50) {
item.quality = item.quality + 1; item.quality++;
} }
} }
} }
@ -37,7 +37,7 @@ class GildedRose {
} }
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) { if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
item.sellIn = item.sellIn - 1; item.sellIn--;
} }
if (item.sellIn < 0) { if (item.sellIn < 0) {
@ -45,15 +45,15 @@ class GildedRose {
if (!item.name.equals("Backstage passes to a TAFKAL80ETC concert")) { if (!item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (item.quality > 0) { if (item.quality > 0) {
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) { if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
item.quality = item.quality - 1; item.quality--;
} }
} }
} else { } else {
item.quality = item.quality - item.quality; item.quality = 0;
} }
} else { } else {
if (item.quality < 50) { if (item.quality < 50) {
item.quality = item.quality + 1; item.quality++;
} }
} }
} }