33 lines
523 B
Swift
33 lines
523 B
Swift
|
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
|
||
|
}
|
||
|
}
|