mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-19 16:31:30 +00:00
28 lines
932 B
TypeScript
28 lines
932 B
TypeScript
import { Item, GildedRose } from '@/gilded-rose';
|
|
|
|
const items = [
|
|
new Item("+5 Dexterity Vest", 10, 20), //
|
|
new Item("Aged Brie", 2, 0), //
|
|
new Item("Elixir of the Mongoose", 5, 7), //
|
|
new Item("Sulfuras, Hand of Ragnaros", 0, 80), //
|
|
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
|
|
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
|
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
|
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
|
// this conjured item does not work properly yet
|
|
new Item("Conjured Mana Cake", 3, 6)];
|
|
|
|
|
|
const gildedRose = new GildedRose(items);
|
|
var days: number = 2;
|
|
for (let i = 0; i < days; i++) {
|
|
console.log("-------- day " + i + " --------");
|
|
console.log("name, sellIn, quality");
|
|
items.forEach(element => {
|
|
console.log(element.name + ' ' + element.sellIn + ' ' + element.quality);
|
|
|
|
});
|
|
console.log();
|
|
gildedRose.updateQuality();
|
|
}
|