mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-04 09:11:39 +00:00
lift up condition with BackstagePasses
This commit is contained in:
parent
39c548b2d6
commit
74c809e44a
@ -20,19 +20,20 @@ class GildedRose {
|
|||||||
item.increaseQualityByOne();
|
item.increaseQualityByOne();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
boolean isBackstagePasses = item.isBackstagePasses();
|
if (item.isBackstagePasses()) {
|
||||||
if (isBackstagePasses) {
|
|
||||||
item.increaseQualityBackstage();
|
item.increaseQualityBackstage();
|
||||||
|
|
||||||
|
item.decreaseSellInEachDay();
|
||||||
|
|
||||||
|
if (item.sellIn < 0) {
|
||||||
|
item.quality = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
item.decreaseQualityByOne();
|
item.decreaseQualityByOne();
|
||||||
}
|
|
||||||
|
|
||||||
item.decreaseSellInEachDay();
|
item.decreaseSellInEachDay();
|
||||||
|
|
||||||
if (item.sellIn < 0) {
|
if (item.sellIn < 0) {
|
||||||
if (isBackstagePasses) {
|
|
||||||
item.quality = 0;
|
|
||||||
} else {
|
|
||||||
item.decreaseQualityByOne();
|
item.decreaseQualityByOne();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user