mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
25 lines
643 B
C#
25 lines
643 B
C#
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using csharp.StrategyPatternExample;
|
|
|
|
namespace csharp.StrategyPatternExample
|
|
{
|
|
public class GildedRoseStrategyPatternExample : IGildedRoseApp
|
|
{
|
|
private IList<ItemWrapperContext> Items;
|
|
|
|
public GildedRoseStrategyPatternExample(IList<Item> Items)
|
|
{
|
|
this.Items = Items.Select(i => new ItemWrapperContext(i)).ToList<ItemWrapperContext>();
|
|
}
|
|
|
|
public void UpdateQuality()
|
|
{
|
|
for (var i = 0; i < Items.Count; i++)
|
|
{
|
|
Items[i].UpdateQuality();
|
|
}
|
|
}
|
|
}
|
|
}
|