mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
replace item = item + by item += and also for -
This commit is contained in:
parent
977921ee3c
commit
cc1a3411d3
@ -10,30 +10,28 @@ class GildedRose {
|
|||||||
public void updateQuality() {
|
public void updateQuality() {
|
||||||
for (Item item : items) {
|
for (Item item : items) {
|
||||||
if (item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
if (item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||||
System.out.println("item is equal to Sulfura, breaking" +
|
|
||||||
"items = " + item.name);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item.name.equals("Aged Brie")
|
if (!item.name.equals("Aged Brie")
|
||||||
&& !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) {
|
||||||
item.quality = item.quality - 1;
|
item.quality -= 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (item.quality < 50) {
|
if (item.quality < 50) {
|
||||||
item.quality = item.quality + 1;
|
item.quality += 1;
|
||||||
|
|
||||||
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 += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.sellIn < 6) {
|
if (item.sellIn < 6) {
|
||||||
if (item.quality < 50) {
|
if (item.quality < 50) {
|
||||||
item.quality = item.quality + 1;
|
item.quality += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -46,14 +44,14 @@ class GildedRose {
|
|||||||
if (!item.name.equals("Aged Brie")) {
|
if (!item.name.equals("Aged Brie")) {
|
||||||
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) {
|
||||||
item.quality = item.quality - 1;
|
item.quality -= 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
item.quality = item.quality - item.quality;
|
item.quality -= item.quality;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (item.quality < 50) {
|
if (item.quality < 50) {
|
||||||
item.quality = item.quality + 1;
|
item.quality += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user