//
//  SharingData.swift
//  forShip
//
//  Created by Mamoru Sugita on 2023/10/20.
//
import Foundation
import CoreLocation

class SharingData: ObservableObject{
    static let shared = SharingData()
    
    class My{
        static var location: CLLocationCoordinate2D? = nil
        static var speedKnot: Double = 0.0
        static var bearing: Double = 0.0        // 自船進行方向
        static var compass: Double? = nil       // 端末の方位
        
        static func reset() {
            location = nil
            speedKnot = 0.0
            bearing = 0.0
        }
    }
    
    /**
     * Eca
     */
    @Published var ecaArea: Dictionary<String, RegisteredEca> = [:]
    
    func editEcaArea(key: String, value: RegisteredEca){
        ecaArea.updateValue(value, forKey: key)
    }
    
    
}
