Skip to content

Commit a7d8769

Browse files
committed
feat: add UnityPackage model to World model
1 parent 255fe37 commit a7d8769

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

Sources/VRCKit/Models/FavoriteWorldModel+Initializer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public extension FavoriteWorld {
3232
popularity: world.popularity,
3333
heat: world.heat,
3434
favoriteGroup: favoriteGroup,
35-
version: world.version
35+
version: world.version,
36+
unityPackages: world.unityPackages
3637
)
3738
}
3839
}

Sources/VRCKit/Models/FavoriteWorldModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public struct FavoriteWorld: Codable, Sendable, Identifiable, Hashable {
4040
public let heat: Int
4141
public let favoriteGroup: String
4242
public let version: Int?
43+
public let unityPackages: [UnityPackage]
4344
}
4445

4546
extension FavoriteWorldWrapper: Decodable {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// UnityPackageModel.swift
3+
// VRCKit
4+
//
5+
// Created by makinosp on 2024/09/29.
6+
//
7+
8+
import Foundation
9+
import MemberwiseInit
10+
11+
@MemberwiseInit(.public)
12+
public struct UnityPackage: Codable, Sendable, Identifiable, Hashable {
13+
public let id: String
14+
public let assetUrl: URL?
15+
public let assetVersion: Int
16+
public let createdAt: Date
17+
public let platform: Platform
18+
public let unitySortNumber: Int
19+
public let unityVersion: String
20+
21+
public enum Platform: String, Codable, Sendable {
22+
case android, ios, standalonewindows
23+
}
24+
}

Sources/VRCKit/Models/WorldModel+Initializers.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public extension World {
3131
visits: world.visits,
3232
popularity: world.popularity,
3333
heat: world.heat,
34-
version: world.version
34+
version: world.version,
35+
unityPackages: world.unityPackages
3536
)
3637
}
3738
}

Sources/VRCKit/Models/WorldModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public struct World: Codable, Sendable, Identifiable, Hashable {
3333
public let popularity: Int
3434
public let heat: Int
3535
public let version: Int?
36+
public let unityPackages: [UnityPackage]
3637

3738
public enum ReleaseStatus: String, Codable, Sendable {
3839
case `public`, `private`, hidden, all

0 commit comments

Comments
 (0)