31 lines
522 B
Swift
31 lines
522 B
Swift
|
import Foundation
|
||
|
|
||
|
struct Cap: Codable {
|
||
|
|
||
|
let id: Int
|
||
|
|
||
|
var name: String
|
||
|
|
||
|
var count: Int
|
||
|
|
||
|
var mainImage: Int
|
||
|
|
||
|
/// The version of the first classifier trained on this cap
|
||
|
var classifierVersion: Int
|
||
|
|
||
|
enum CodingKeys: String, CodingKey {
|
||
|
case id = "i"
|
||
|
case name = "n"
|
||
|
case count = "c"
|
||
|
case mainImage = "m"
|
||
|
case classifierVersion = "v"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
extension Cap: Comparable {
|
||
|
|
||
|
static func < (lhs: Cap, rhs: Cap) -> Bool {
|
||
|
lhs.id < rhs.id
|
||
|
}
|
||
|
}
|