//
//  AlertDB.swift
//  Sailassist
//
//  Created by 三浦薫巳 on 2023/11/19.
//

import Foundation

struct WarnRecord {
    var title: String
    var body: String
}

enum SwitchingAlert {
    case Finish
    case Start
    case Notice

    case NgaPassing

    init() {
        self = .Notice
    }
}

class AlertDB {
    // シングルトン宣言
    static let OnlyOne = AlertDB()

    private var alertEca : [SwitchingAlert: WarnRecord] = [
        SwitchingAlert.Finish: WarnRecord(title: String("No Fuel Switching Finished"), body: String("Arrived at switching finished point.")),
        SwitchingAlert.Start: WarnRecord(title: NSLocalizedString("Eca Start", comment: ""), body: NSLocalizedString("Arrived at switching start point.", comment: "")),
        SwitchingAlert.Notice: WarnRecord(title: NSLocalizedString("Eca Notice", comment: ""), body: NSLocalizedString("Arrived at advance notice point.", comment: "")),

        SwitchingAlert.NgaPassing: WarnRecord(title: String("NGA Notice "), body: String("NGA Passing."))
    ]

    //Eca通知
    func GetAlertEcaPoint(point : SwitchingAlert) -> WarnRecord {
        return alertEca[point]!
    }

    //Nga通知
    func GetAlertNgaPoint(point : SwitchingAlert) -> WarnRecord {
        return alertEca[point]!
    }
}
