Caps-iOS/Caps/Data/CapData.swift

33 lines
523 B
Swift
Raw Normal View History

2022-06-10 21:20:49 +02:00
import Foundation
struct CapData: Codable {
let id: Int
var name: String
var count: Int
var mainImage: Int
var classifierVersion: Int?
var color: Cap.Color?
enum CodingKeys: String, CodingKey {
case id = "i"
case name = "n"
case count = "c"
case mainImage = "m"
case classifierVersion = "v"
case color = "f"
}
}
extension CapData: Comparable {
static func < (lhs: CapData, rhs: CapData) -> Bool {
lhs.id < rhs.id
}
}