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