TargetsEditorDataFlow.swift 739 B

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