mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-22 18:01:07 +00:00
update updateQuality method
update updateQuality method to process each item individually Aged Brie then Backstage passes then Sulfuras then the rest of items
This commit is contained in:
parent
bdcd441019
commit
e0c5b8b5bd
@ -22,12 +22,11 @@ class GildedRose {
|
||||
}
|
||||
|
||||
private static void updateQuality(Item item) {
|
||||
if (item.name.equals("Aged Brie")
|
||||
|| item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (item.name.equals("Aged Brie")) {
|
||||
if (item.quality < 50) {
|
||||
item.quality++;
|
||||
|
||||
if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
}
|
||||
} else if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (item.sellIn < 11) {
|
||||
if (item.quality < 50) {
|
||||
item.quality++;
|
||||
@ -39,16 +38,12 @@ class GildedRose {
|
||||
item.quality++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (item.quality > 0) {
|
||||
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
} else if (item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
return;
|
||||
} else if (item.quality > 0) {
|
||||
item.quality--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void updateSelling(Item item) {
|
||||
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user