feat: Initial commit
This commit is contained in:
18
Sources/SharedModels/Velocity.swift
Normal file
18
Sources/SharedModels/Velocity.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
import Foundation
|
||||
|
||||
public struct Velocity: Equatable {
|
||||
public var airflow: Double
|
||||
public var dimension: PlenumDimension
|
||||
|
||||
public var value: Double {
|
||||
airflow / dimension.areaInSquareFeet
|
||||
}
|
||||
|
||||
public var flagged: Flagged { .velocity(self) }
|
||||
}
|
||||
|
||||
extension Flagged {
|
||||
public static func velocity(_ velocity: Velocity) -> Self {
|
||||
.init(wrappedValue: velocity.value, .velocity())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user