diff options
Diffstat (limited to '')
-rw-r--r-- | foray/Models/PenguinItemViewModel.swift | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/foray/Models/PenguinItemViewModel.swift b/foray/Models/PenguinItemViewModel.swift index 9b9b058..dcaa16d 100644 --- a/foray/Models/PenguinItemViewModel.swift +++ b/foray/Models/PenguinItemViewModel.swift @@ -6,6 +6,7 @@ // import Foundation +import UIKit struct PenguinItemViewModel { let type: PenguinItemType @@ -13,4 +14,22 @@ struct PenguinItemViewModel { let year: Int let id: String let name: String + + var typeName: String { + switch type { + case .item: + return "Item" + case .quest: + return "Quest" + } + } + + var icon: UIImage { + switch type { + case .item: + return UIImage(named: id) ?? UIImage.fromAsset(.spy) + case .quest: + return UIImage.fromAsset(.spy) + } + } } |