Skip to content

Commit

Permalink
feat: add UnityPackage model to World model
Browse files Browse the repository at this point in the history
  • Loading branch information
makinosp committed Sep 29, 2024
1 parent 255fe37 commit a7d8769
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Sources/VRCKit/Models/FavoriteWorldModel+Initializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public extension FavoriteWorld {
popularity: world.popularity,
heat: world.heat,
favoriteGroup: favoriteGroup,
version: world.version
version: world.version,
unityPackages: world.unityPackages
)
}
}
1 change: 1 addition & 0 deletions Sources/VRCKit/Models/FavoriteWorldModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public struct FavoriteWorld: Codable, Sendable, Identifiable, Hashable {
public let heat: Int
public let favoriteGroup: String
public let version: Int?
public let unityPackages: [UnityPackage]
}

extension FavoriteWorldWrapper: Decodable {
Expand Down
24 changes: 24 additions & 0 deletions Sources/VRCKit/Models/UnityPackageModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// UnityPackageModel.swift
// VRCKit
//
// Created by makinosp on 2024/09/29.
//

import Foundation
import MemberwiseInit

@MemberwiseInit(.public)
public struct UnityPackage: Codable, Sendable, Identifiable, Hashable {
public let id: String
public let assetUrl: URL?
public let assetVersion: Int
public let createdAt: Date
public let platform: Platform
public let unitySortNumber: Int
public let unityVersion: String

public enum Platform: String, Codable, Sendable {
case android, ios, standalonewindows
}
}
3 changes: 2 additions & 1 deletion Sources/VRCKit/Models/WorldModel+Initializers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public extension World {
visits: world.visits,
popularity: world.popularity,
heat: world.heat,
version: world.version
version: world.version,
unityPackages: world.unityPackages
)
}
}
1 change: 1 addition & 0 deletions Sources/VRCKit/Models/WorldModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public struct World: Codable, Sendable, Identifiable, Hashable {
public let popularity: Int
public let heat: Int
public let version: Int?
public let unityPackages: [UnityPackage]

public enum ReleaseStatus: String, Codable, Sendable {
case `public`, `private`, hidden, all
Expand Down

0 comments on commit a7d8769

Please sign in to comment.