mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
調整item.sellIn順序 且將<0的判斷塞入 item.name的判斷式中
This commit is contained in:
parent
4cfe62665d
commit
31f7d222ea
@ -17,34 +17,33 @@ class GildedRose {
|
|||||||
if (item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
if (item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.name.equals("Aged Brie")) {
|
|
||||||
increaseQuality(item);
|
|
||||||
} else if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
|
||||||
increaseQuality(item);
|
|
||||||
if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
|
||||||
if (item.sellIn < 11) {
|
|
||||||
increaseQuality(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.sellIn < 6) {
|
|
||||||
increaseQuality(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
decreaseQuality(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
item.sellIn = item.sellIn - 1;
|
item.sellIn = item.sellIn - 1;
|
||||||
|
|
||||||
if (item.sellIn < 0) {
|
if (item.name.equals("Aged Brie")) {
|
||||||
if (item.name.equals("Aged Brie")) {
|
increaseQuality(item);
|
||||||
|
if (item.sellIn < 0) {
|
||||||
increaseQuality(item);
|
increaseQuality(item);
|
||||||
} else {
|
}
|
||||||
if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
} else if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||||
item.quality = item.quality - item.quality;
|
increaseQuality(item);
|
||||||
} else {
|
|
||||||
decreaseQuality(item);
|
if (item.sellIn < 10) {
|
||||||
}
|
increaseQuality(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.sellIn < 5) {
|
||||||
|
increaseQuality(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.sellIn < 0) {
|
||||||
|
item.quality = item.quality - item.quality;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
decreaseQuality(item);
|
||||||
|
if (item.sellIn < 0) {
|
||||||
|
decreaseQuality(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user