mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-08 03:01:24 +00:00
19 lines
541 B
C#
19 lines
541 B
C#
namespace GildedRoseKata;
|
|
|
|
using GildedRoseKata.Strategies;
|
|
|
|
public static class UpdateStrategyFactory
|
|
{
|
|
public static IUpdateStrategy CreateStrategy(string itemName)
|
|
{
|
|
return itemName switch
|
|
{
|
|
ItemCategory.AgedBrie => new AgedBrieStrategy(),
|
|
ItemCategory.BackstagePasses => new BackstagePassStrategy(),
|
|
ItemCategory.Sulfuras => new SulfurasStrategy(),
|
|
ItemCategory.Conjured => new ConjuredItemStrategy(),
|
|
_ => new StandardItemStrategy()
|
|
};
|
|
}
|
|
}
|