CREditorDataFlow.swift 690 B

12345678910111213141516171819202122232425262728293031
  1. import Foundation
  2. enum CREditor {
  3. enum Config {}
  4. class Item: Identifiable, Hashable, Equatable {
  5. let id = UUID()
  6. var rateIndex = 0
  7. var timeIndex = 0
  8. init(rateIndex: Int, timeIndex: Int) {
  9. self.rateIndex = rateIndex
  10. self.timeIndex = timeIndex
  11. }
  12. static func == (lhs: Item, rhs: Item) -> Bool {
  13. lhs.timeIndex == rhs.timeIndex
  14. }
  15. func hash(into hasher: inout Hasher) {
  16. hasher.combine(timeIndex)
  17. }
  18. }
  19. }
  20. protocol CREditorProvider: Provider {
  21. var profile: CarbRatios { get }
  22. func saveProfile(_ profile: CarbRatios)
  23. var autotune: Autotune? { get }
  24. }