Skip to content

Commit

Permalink
Wrap RelativeLineStringDistance in Swift Package
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Oct 15, 2023
1 parent 07304d0 commit 4f4fdf3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apple/Sources/FerrostarCore/ModelWrappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,18 @@ public enum StepAdvanceMode {
///
/// Distance and horizontal accuracy are measured in meters.
case distanceToEndOfStep(distance: UInt16, minimumHorizontalAccuracy: UInt16)
/// Automatically advances when the user's distance to the *next* step's linestring is less
/// than or equal to the distance to the current step's linestring.
case relativeLineStringDistance(minimumHorizontalAccuracy: UInt16)

var ffiValue: UniFFI.StepAdvanceMode {
switch self {
case .manual:
return .manual
case .distanceToEndOfStep(distance: let distance, minimumHorizontalAccuracy: let minimumHorizontalAccuracy):
return .distanceToEndOfStep(distance: distance, minimumHorizontalAccuracy: minimumHorizontalAccuracy)
case .relativeLineStringDistance(minimumHorizontalAccuracy: let minimumHorizontalAccuracy):
return .relativeLineStringDistance(minimumHorizontalAccuracy: minimumHorizontalAccuracy)
}
}
}

0 comments on commit 4f4fdf3

Please sign in to comment.