Add more objects

This commit is contained in:
Richard Xu 2022-12-22 13:18:35 -05:00
parent 97a96bb1e2
commit 3614b55d3e
3 changed files with 15 additions and 13 deletions

View File

@ -0,0 +1,10 @@
package com.gildedrose;
public class AgedBrieItem {
public static void handleDay(Item item) {
if (item.quality != 50) {
item.quality += 1;
}
item.sellIn -= 1;
}
}

View File

@ -21,10 +21,9 @@ class GildedRose {
private static void handleDay(Item item) {
switch (item.name) {
case AGED_BRIE:
handleAgedBrie(item);
AgedBrieItem.handleDay(item);
return;
case SULFURAS:
handleSulfuras(item);
return;
case BACKSTAGE_PASSES:
BackstagePassesItem.handleDay(item);
@ -33,15 +32,4 @@ class GildedRose {
GenericItem.handleDay(item);
}
}
private static void handleSulfuras(Item item) {
}
private static void handleAgedBrie(Item item) {
if (item.quality != 50) {
item.quality += 1;
}
item.sellIn -= 1;
}
}

View File

@ -0,0 +1,4 @@
package com.gildedrose;
public class SulfurasItem {
}