mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-19 16:31:30 +00:00
Extract sellIn decrease into private method
This commit is contained in:
parent
2fb5d2bc77
commit
f040a5d3fb
@ -44,7 +44,7 @@ class GildedRose {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!currentItem.name.equals(ITEM_SULFURAS_HAND_OF_RAGNAROS)) {
|
if (!currentItem.name.equals(ITEM_SULFURAS_HAND_OF_RAGNAROS)) {
|
||||||
currentItem.sellIn = currentItem.sellIn - 1;
|
decreaseSellIn(currentItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentItem.sellIn < 0) {
|
if (currentItem.sellIn < 0) {
|
||||||
@ -74,4 +74,8 @@ class GildedRose {
|
|||||||
private void increaseQuality(Item item) {
|
private void increaseQuality(Item item) {
|
||||||
item.quality = item.quality + 1;
|
item.quality = item.quality + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void decreaseSellIn(Item item) {
|
||||||
|
item.sellIn = item.sellIn - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user