@@ -7,23 +7,19 @@ namespace PlateauResoniteLink.Cli;
77public sealed class ImportCommandOptions (
88 PlateauImportRequest Request ,
99 string WorkRoot ,
10- Uri ? ResoniteLinkUri ,
11- int ResoniteLinkConnectionCount ,
10+ ImportDestination Destination ,
1211 PlateauImportMemoryProfile MemoryProfile ,
1312 bool EnableMeshBake ,
1413 string ? TerrainTileCacheRoot ,
1514 bool DisableTerrainTileCache ,
16- string ? CanonicalSceneDumpPath ,
1715 bool EnableSendMetrics ,
1816 bool VerboseLogging ) : CliCommandOptions
1917{
2018 public PlateauImportRequest Request { get ; } = Request ?? throw new ArgumentNullException ( nameof ( Request ) ) ;
2119
2220 public string WorkRoot { get ; } = WorkRoot ?? throw new ArgumentNullException ( nameof ( WorkRoot ) ) ;
2321
24- public Uri ? ResoniteLinkUri { get ; } = ResoniteLinkUri ;
25-
26- public int ResoniteLinkConnectionCount { get ; } = ResoniteLinkConnectionCount ;
22+ public ImportDestination Destination { get ; } = Destination ?? throw new ArgumentNullException ( nameof ( Destination ) ) ;
2723
2824 public PlateauImportMemoryProfile MemoryProfile { get ; } = MemoryProfile ;
2925
@@ -33,9 +29,50 @@ public sealed class ImportCommandOptions(
3329
3430 public bool DisableTerrainTileCache { get ; } = DisableTerrainTileCache ;
3531
36- public string ? CanonicalSceneDumpPath { get ; } = CanonicalSceneDumpPath ;
37-
3832 public bool EnableSendMetrics { get ; } = EnableSendMetrics ;
3933
4034 public bool VerboseLogging { get ; } = VerboseLogging ;
4135}
36+
37+ public abstract record ImportDestination
38+ {
39+ private ImportDestination ( )
40+ {
41+ }
42+
43+ public sealed record Live : ImportDestination
44+ {
45+ public Live ( Uri resoniteLinkUri , int connectionCount )
46+ {
47+ ArgumentNullException . ThrowIfNull ( resoniteLinkUri ) ;
48+ if ( ! resoniteLinkUri . IsAbsoluteUri )
49+ {
50+ throw new ArgumentException ( "The ResoniteLink URI must be absolute." , nameof ( resoniteLinkUri ) ) ;
51+ }
52+
53+ if ( connectionCount < 1 )
54+ {
55+ throw new ArgumentOutOfRangeException ( nameof ( connectionCount ) , connectionCount , "Connection count must be positive." ) ;
56+ }
57+
58+ ResoniteLinkUri = resoniteLinkUri ;
59+ ConnectionCount = connectionCount ;
60+ }
61+
62+ public Uri ResoniteLinkUri { get ; }
63+
64+ public int ConnectionCount { get ; }
65+ }
66+
67+ public sealed record CanonicalSceneDump : ImportDestination
68+ {
69+ public CanonicalSceneDump ( string path )
70+ {
71+ ArgumentException . ThrowIfNullOrWhiteSpace ( path ) ;
72+
73+ Path = path ;
74+ }
75+
76+ public string Path { get ; }
77+ }
78+ }
0 commit comments