mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-11 04:31:21 +00:00
em
This commit is contained in:
parent
60d41e79e1
commit
0155b204a2
@ -23,7 +23,7 @@ public class Item {
|
|||||||
|
|
||||||
decreaseSellInEachDay();
|
decreaseSellInEachDay();
|
||||||
|
|
||||||
if (sellIn < 0) {
|
if (isExpired()) {
|
||||||
increaseQualityByOne();
|
increaseQualityByOne();
|
||||||
}
|
}
|
||||||
} else if (isBackstagePasses()) {
|
} else if (isBackstagePasses()) {
|
||||||
@ -31,7 +31,7 @@ public class Item {
|
|||||||
|
|
||||||
decreaseSellInEachDay();
|
decreaseSellInEachDay();
|
||||||
|
|
||||||
if (sellIn < 0) {
|
if (isExpired()) {
|
||||||
quality = 0;
|
quality = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -39,12 +39,16 @@ public class Item {
|
|||||||
|
|
||||||
decreaseSellInEachDay();
|
decreaseSellInEachDay();
|
||||||
|
|
||||||
if (sellIn < 0) {
|
if (isExpired()) {
|
||||||
decreaseQualityByOne();
|
decreaseQualityByOne();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isExpired() {
|
||||||
|
return sellIn < 0;
|
||||||
|
}
|
||||||
|
|
||||||
boolean isBackstagePasses() {
|
boolean isBackstagePasses() {
|
||||||
return name.equals(BACKSTAGE_PASSES);
|
return name.equals(BACKSTAGE_PASSES);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user