2 // ShipWindowController.swift
5 // Created by Hori,Masaki on 2017/01/05.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 class ShipWindowController: NSWindowController {
12 let managedObjectContext = ServerDataStore.default.context
14 override var windowNibName: String! {
15 return "ShipWindowController"
17 dynamic var missionFleetNumber: Int = 0
18 dynamic var missionTime: NSNumber?
20 @IBAction func changeMissionTime(_ sender: AnyObject?) {
21 window?.endEditing(for: nil)
23 let store = ServerDataStore.oneTimeEditor()
24 guard let deck = store.deck(by: missionFleetNumber),
25 let t = missionTime as? Double
27 let time = Date(timeIntervalSinceNow: t).timeIntervalSince1970 * 1_000
28 deck.mission_2 = Int(time)