mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
if item equals to Sulfara break out the loop
This commit is contained in:
parent
8b5693d77a
commit
977921ee3c
@ -9,12 +9,16 @@ class GildedRose {
|
||||
|
||||
public void updateQuality() {
|
||||
for (Item item : items) {
|
||||
if (item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
System.out.println("item is equal to Sulfura, breaking" +
|
||||
"items = " + item.name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!item.name.equals("Aged Brie")
|
||||
&& !item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (item.quality > 0) {
|
||||
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
item.quality = item.quality - 1;
|
||||
}
|
||||
item.quality = item.quality - 1;
|
||||
}
|
||||
} else {
|
||||
if (item.quality < 50) {
|
||||
@ -36,17 +40,13 @@ class GildedRose {
|
||||
}
|
||||
}
|
||||
|
||||
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
item.sellIn = item.sellIn - 1;
|
||||
}
|
||||
item.sellIn = item.sellIn - 1;
|
||||
|
||||
if (item.sellIn < 0) {
|
||||
if (!item.name.equals("Aged Brie")) {
|
||||
if (!item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (item.quality > 0) {
|
||||
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
item.quality = item.quality - 1;
|
||||
}
|
||||
item.quality = item.quality - 1;
|
||||
}
|
||||
} else {
|
||||
item.quality = item.quality - item.quality;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user