Files
Project_Velocity/iOS/velocity-ipad/velocity/Features/Inventory/InventoryModeAvailability.swift
sayan eeb684b46c
All checks were successful
Production Readiness / backend-contracts (push) Successful in 1m47s
Production Readiness / webos-typecheck (push) Successful in 1m50s
Production Readiness / ipad-parse (push) Successful in 1m34s
feat: Ipad app production readiness, Colony orchestration, Social posting (#44)
#38 Ipad app production readiness, Colony orchestration, Social posting

Co-authored-by: Sayan Datta <sayan@Sayans-MacBook-Air.local>
Reviewed-on: #44
2026-05-03 18:30:38 +05:30

33 lines
1.1 KiB
Swift

import Foundation
enum InventoryModeAvailability {
static let dollhouseAssetCandidates: [(name: String, ext: String)] = [
("Building", "usdz"),
("Building", "scn"),
]
static func hasShippedDollhouseAsset(in bundle: Bundle = .main) -> Bool {
dollhouseAssetCandidates.contains { candidate in
bundle.url(forResource: candidate.name, withExtension: candidate.ext) != nil
}
}
static func productionVisibleModes(hasDollhouseAsset: Bool) -> [InventoryStore.Mode] {
[.sunseeker, .dreamWeaver]
}
static func sanitizedProductionSelection(
_ candidate: InventoryStore.Mode,
hasDollhouseAsset: Bool
) -> InventoryStore.Mode {
productionVisibleModes(hasDollhouseAsset: hasDollhouseAsset).contains(candidate) ? candidate : .sunseeker
}
static func modeSummaryText(hasDollhouseAsset: Bool) -> String {
let base = productionVisibleModes(hasDollhouseAsset: hasDollhouseAsset).map(\.rawValue)
return hasDollhouseAsset
? (base + ["Map-to-Dollhouse"]).joined(separator: " · ")
: base.joined(separator: " · ")
}
}