Skip to content

Commit

Permalink
Adding custom SpinRate option
Browse files Browse the repository at this point in the history
  • Loading branch information
mergesort committed May 23, 2024
1 parent 4daa9bf commit a9603b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Pow/Effects/SpinEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,29 @@ public extension AnyChangeEffect {
enum SpinRate {
case `default`
case fast
case custom(initialVelocity: Angle, maximumVelocity: Angle, additionalVelocity: Angle)

fileprivate var maximumVelocity: Angle {
switch self {
case .fast: return .degrees(360 * 4)
case .default: return .degrees(360 * 2)
case .custom(_, let maximumVelocity, _): return maximumVelocity
}
}

fileprivate var initialVelocity: Angle {
switch self {
case .fast: return .degrees(900)
case .default: return .degrees(360)
case .custom(let initialVelocity, _, _): return initialVelocity
}
}

fileprivate var additionalVelocity: Angle {
switch self {
case .fast: return .degrees(900)
case .default: return .degrees(360)
case .custom(_, _, let additionalVelocity): return additionalVelocity
}
}
}
Expand Down

0 comments on commit a9603b2

Please sign in to comment.