File tree Expand file tree Collapse file tree 5 files changed +18
-14
lines changed
Preview Content/Airport Fixtures
SF50 TOLD.xcodeproj/xcshareddata/xcschemes
SF50 TOLD/Loaders/AirportLoader Expand file tree Collapse file tree 5 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import SwiftNASR
66// MARK: - Defaults
77
88nonisolated ( unsafe) private let groupDefaults = UserDefaults ( suiteName: " group.codes.tim.TOLD " ) !
9- public let latestSchemaVersion = 4
9+ public let latestSchemaVersion = 5
1010
1111extension Defaults . Keys {
1212 public static let emptyWeight = Key < Measurement < UnitMass > > (
Original file line number Diff line number Diff line change @@ -75,9 +75,13 @@ public final class Runway {
7575 @Relationship ( deleteRule: . cascade, inverse: \NOTAM . runway)
7676 public var notam : NOTAM ?
7777
78+ /// Name of the reciprocal runway (e.g., "10R" for runway "28L")
79+ public var reciprocalName : String ?
80+
7881 /// The reciprocal runway (opposite direction on same surface)
79- @Relationship ( deleteRule: . nullify)
80- public var reciprocal : Runway ?
82+ public var reciprocal : Runway ? {
83+ airport. runways. first { $0. name == reciprocalName }
84+ }
8185
8286 #Unique< Runway> ( [ \. airport, \. name] )
8387
@@ -234,7 +238,7 @@ public final class Runway {
234238 _thresholdLatitude = thresholdCoordinate? . latitude
235239 _thresholdLongitude = thresholdCoordinate? . longitude
236240 self . airport = airport
237- reciprocal = nil
241+ reciprocalName = nil
238242 notam = nil
239243 }
240244
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ extension AirportBuilder {
5252 airport: airport
5353 )
5454
55- rwy15. reciprocal = rwy33
56- rwy33. reciprocal = rwy15
55+ rwy15. reciprocalName = " 33 "
56+ rwy33. reciprocalName = " 15 "
5757
5858 return [ rwy15, rwy33]
5959 }
Original file line number Diff line number Diff line change 3333 reference = " container:Generate Screenshots/Generate Screenshots.xctestplan" >
3434 </TestPlanReference >
3535 <TestPlanReference
36- reference = " container:SF50 SharedTests/SF50 Shared Unit Tests.xctestplan"
37- default = " YES" >
36+ reference = " container:SF50 SharedTests/SF50 Shared Unit Tests.xctestplan" >
3837 </TestPlanReference >
3938 <TestPlanReference
4039 reference = " container:SF50 TOLDUITests/SF50 TOLD UI Tests.xctestplan" >
4140 </TestPlanReference >
41+ <TestPlanReference
42+ reference = " container:SF50 TOLDTests/Unit Tests.xctestplan"
43+ default = " YES" >
44+ </TestPlanReference >
4245 </TestPlans >
4346 <Testables >
4447 <TestableReference
Original file line number Diff line number Diff line change @@ -195,13 +195,10 @@ actor AirportLoader {
195195 modelContext. insert ( runway)
196196 }
197197
198- // Link reciprocal runways
198+ // Set reciprocal runway names
199199 for runwayData in airport. runways {
200- if let reciprocalName = runwayData. reciprocalName,
201- let runway = runwayMap [ runwayData. name] ,
202- let reciprocal = runwayMap [ reciprocalName]
203- {
204- runway. reciprocal = reciprocal
200+ if let runway = runwayMap [ runwayData. name] {
201+ runway. reciprocalName = runwayData. reciprocalName
205202 }
206203 }
207204 }
You can’t perform that action at this time.
0 commit comments