Пример #1
0
        public void UpdateQuality()
        {
            foreach (Item item in Items)
            {
                Item newItem;

                switch (item.Name)
                {
                case "Aged Brie":
                    newItem = new AgedBrie();
                    break;

                case "Backstage passes to a TAFKAL80ETC concert":
                    newItem = new BackstagePasses();
                    break;

                case "Conjured Mana Cake":
                    newItem = new Conjured();
                    break;

                case "Sulfuras, Hand of Ragnaros":
                    newItem = new LegendarySulfuras();
                    break;

                default:
                    newItem = new Item();
                    break;
                }

                newItem.UpdateItemQuality(item);
            }
        }
Пример #2
0
        public ItemFactory(Item i)
        {
            dict = new Dictionary <string, Item>();

            dict[STANDARD]  = new StandardItem(i);
            dict[AgedBrie]  = new AgedBrie(i);
            dict[Sulfuras]  = new Sulfuras(i);
            dict[Backstage] = new BackstagePasses(i);
            dict[Conjured]  = new Conjured(i);
        }