gilded-rose-dotnet-core/Program.cs

57 lines
1.9 KiB
C#
Raw Normal View History

2020-08-31 17:32:41 +00:00
using System;
using System.Collections.Generic;
namespace csharpcore
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("OMGHAI!");
IList<Item> Items = new List<Item>{
new Item {Name = "+5 Dexterity Vest", SellIn = 10, Quality = 20},
new Item {Name = "Aged Brie", SellIn = 2, Quality = 0},
new Item {Name = "Elixir of the Mongoose", SellIn = 5, Quality = 7},
new Item {Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80},
new Item {Name = "Sulfuras, Hand of Ragnaros", SellIn = -1, Quality = 80},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 15,
Quality = 20
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 10,
Quality = 49
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 5,
Quality = 49
},
// this conjured item does not work properly yet
new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
};
var app = new GildedRose(Items);
for (var i = 0; i < 31; i++)
{
Console.WriteLine("-------- day " + i + " --------");
Console.WriteLine("name, sellIn, quality");
2020-08-31 19:36:58 +00:00
foreach (var item in Items)
2020-08-31 17:32:41 +00:00
{
2020-08-31 19:36:58 +00:00
Console.WriteLine(item.Name + ", " + item.SellIn + ", " + item.Quality);
2020-08-31 17:32:41 +00:00
}
Console.WriteLine("");
app.UpdateQuality();
}
}
}
}