mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
32 lines
632 B
Swift
32 lines
632 B
Swift
//
|
|
// File.swift
|
|
//
|
|
//
|
|
// Created by Manali Mogre on 16/08/2020.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
protocol CustomisedItem {
|
|
func updateItemState()
|
|
}
|
|
|
|
class CustomisedItemFactory {
|
|
func getCustomisedItem(item: Item) -> CustomisedItem {
|
|
switch item.name {
|
|
case ItemNameConstants.kAgedBrieItem:
|
|
return AgedBrieItem(item: item)
|
|
case ItemNameConstants.kBackstagePassesItem:
|
|
return BackstagePassesItem(item: item)
|
|
case ItemNameConstants.kSulfurasItem:
|
|
return SulfurasItem(item: item)
|
|
default:
|
|
return StandardItem(item: item)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|