mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-10 20:21:26 +00:00
em
This commit is contained in:
parent
c22e36e674
commit
15ac32868a
@ -28,10 +28,8 @@ class GildedRose {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (items[i].quality > 0) {
|
if (!items[i].name.equals(SULFURAS)) {
|
||||||
if (!items[i].name.equals(SULFURAS)) {
|
decreaseQualityByOne(i);
|
||||||
decreaseQualityByOne(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,14 +41,12 @@ class GildedRose {
|
|||||||
if (items[i].name.equals(AGED_BRIE)) {
|
if (items[i].name.equals(AGED_BRIE)) {
|
||||||
incrementQualityByOne(i);
|
incrementQualityByOne(i);
|
||||||
} else {
|
} else {
|
||||||
if (!items[i].name.equals(BACKSTAGE_PASSES)) {
|
if (items[i].name.equals(BACKSTAGE_PASSES)) {
|
||||||
if (items[i].quality > 0) {
|
|
||||||
if (!items[i].name.equals(SULFURAS)) {
|
|
||||||
decreaseQualityByOne(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
items[i].quality = 0;
|
items[i].quality = 0;
|
||||||
|
} else {
|
||||||
|
if (!items[i].name.equals(SULFURAS)) {
|
||||||
|
decreaseQualityByOne(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,7 +60,9 @@ class GildedRose {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void decreaseQualityByOne(int i) {
|
private void decreaseQualityByOne(int i) {
|
||||||
items[i].quality = items[i].quality - 1;
|
if (items[i].quality > 0) {
|
||||||
|
items[i].quality = items[i].quality - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user