diff --git a/swift/Sources/GildedRose/CustomisedItemFactory.swift b/swift/Sources/GildedRose/CustomisedItemFactory.swift index a2194f58..539e0e15 100644 --- a/swift/Sources/GildedRose/CustomisedItemFactory.swift +++ b/swift/Sources/GildedRose/CustomisedItemFactory.swift @@ -11,9 +11,9 @@ protocol CustomisedItemFactoryCreator { static func getCustomisedItem(item: Item) -> CustomisedItem } -struct CustomisedItemFactory: CustomisedItemFactoryCreator { +class CustomisedItemFactory: CustomisedItemFactoryCreator { // Returns the Customised Item based on the Item name - static func getCustomisedItem(item: Item) -> CustomisedItem { + class func getCustomisedItem(item: Item) -> CustomisedItem { switch item.name { case ItemNameConstants.kAgedBrieItem: return AgedBrieItem(item: item) @@ -26,3 +26,4 @@ struct CustomisedItemFactory: CustomisedItemFactoryCreator { } } } + diff --git a/swift/Sources/GildedRose/Items/StandardItem.swift b/swift/Sources/GildedRose/Items/StandardItem.swift index 93ecb58f..f0b1e370 100644 --- a/swift/Sources/GildedRose/Items/StandardItem.swift +++ b/swift/Sources/GildedRose/Items/StandardItem.swift @@ -7,7 +7,7 @@ import Foundation -struct StandardItem: CustomisedItem, ItemStateUpdater { +class StandardItem: CustomisedItem, ItemStateUpdater { var item: Item private var isSellInDatePassed: Bool{