mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-20 00:41:07 +00:00
23 lines
609 B
Java
23 lines
609 B
Java
package com.gildedrose;
|
|
|
|
import com.gildedrose.SellInUpdater;
|
|
import com.gildedrose.QualityUpdater;
|
|
|
|
class GildedRose {
|
|
Item[] items;
|
|
SellInUpdater sellInUpdater = new SellInUpdater();
|
|
QualityUpdater qualityUpdater = new QualityUpdater();
|
|
|
|
public GildedRose(Item[] items) {
|
|
this.items = items;
|
|
}
|
|
|
|
//For each item update the SellIn value and adjust quality accordingly
|
|
public void updateQuality() throws Exception {
|
|
for (Item item : items) {
|
|
sellInUpdater.updateSellInValue(item);
|
|
qualityUpdater.updateQualityForItem(item);
|
|
}
|
|
}
|
|
|
|
} |