subscript(_ index: Int) -> Ship? { return deck?[index] }
- override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+ override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
if context == &pDeckContext {
sakutekiCalculator = Formula33(Int(factor))
}
- fleetController.bind(NSBindingName(#keyPath(NSArrayController.content)), to:self, withKeyPath:#keyPath(fleet), options:nil)
- fleetController.addObserver(self, forKeyPath:"selection.name", context:nil)
+ fleetController.bind(NSBindingName(#keyPath(NSArrayController.content)), to: self, withKeyPath: #keyPath(fleet), options: nil)
+ fleetController.addObserver(self, forKeyPath: "selection.name", context: nil)
shipKeys.forEach {
let keyPath = "selection.\($0)"
- fleetController.addObserver(self, forKeyPath:keyPath, context:&shipKeysContext)
+ fleetController.addObserver(self, forKeyPath: keyPath, context: &shipKeysContext)
}
buildAnchorageRepairHolder()
let store = ServerDataStore.default
switch damagedPos {
- case 1...6: return store.deck(by: 1)?.shipId(of:damagedPos - 1)
+ case 1...6: return store.deck(by: 1)?.shipId(of: damagedPos - 1)
case 7...12: return store.deck(by: 2)?.shipId(of: damagedPos - 6 - 1)
default: return nil
}
switch type {
case .and: return NSCompoundPredicate(andPredicateWithSubpredicates: p)
- case .or: return NSCompoundPredicate(orPredicateWithSubpredicates: p)
- case .not: return NSCompoundPredicate(notPredicateWithSubpredicate: self.compound(predicates: p))
+ case .or: return NSCompoundPredicate(orPredicateWithSubpredicates: p)
+ case .not: return NSCompoundPredicate(notPredicateWithSubpredicate: self.compound(predicates: p))
}
}
}
}
- override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+ override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
if context == &shipContext {
}
}
-// swiftlint:disable type_body_length
final class TSVSupport {
private let store = LocalDataStore.oneTimeEditor()