mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-19 00:11:35 +00:00
Update extracted expired
This commit is contained in:
parent
617871422e
commit
00763585f8
@ -51,8 +51,18 @@ class GildedRose {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ----- Block 3 ----- Item sell date is less than 0
|
// ----- Block 3 ----- Item sell date is less than 0
|
||||||
|
handleIfExpired(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleIfExpired(Item item) {
|
||||||
if (item.sellIn < 0) {
|
if (item.sellIn < 0) {
|
||||||
|
|
||||||
|
handleExpired(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleExpired(Item item) {
|
||||||
// Reduce quality of items by - 1 if greater than 0 and not AB, BptaTc or SHoR
|
// Reduce quality of items by - 1 if greater than 0 and not AB, BptaTc or SHoR
|
||||||
if (!item.name.equals("Aged Brie")) {
|
if (!item.name.equals("Aged Brie")) {
|
||||||
if (!item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
if (!item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||||
@ -74,5 +84,3 @@ class GildedRose {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user