Caps-Server/Sources/App/Cap.swift
2023-03-20 15:25:58 +01:00

39 lines
543 B
Swift

import Foundation
struct Cap: Codable {
let id: Int
var name: String
var count: Int
var mainImage: Int
var color: Color?
enum CodingKeys: String, CodingKey {
case id = "i"
case name = "n"
case count = "c"
case mainImage = "m"
case color = "f"
}
struct Color: Codable, Equatable {
let r: Int
let g: Int
let b: Int
}
}
extension Cap: Comparable {
static func < (lhs: Cap, rhs: Cap) -> Bool {
lhs.id < rhs.id
}
}