OSDN Git Service

Equatableを自動実装させるようにした
[kcd/KCD.git] / KCD / Quest.swift
index 924e420..ce83056 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class Quest: KCManagedObject {
     
     @NSManaged var bonus_flag: Bool
@@ -25,13 +25,19 @@ final class Quest: KCManagedObject {
     @NSManaged var title: String
     @NSManaged var type: Int
 }
-// swiftlint:eable variable_name
+// swiftlint:eable identifier_name
 
 extension Quest {
     
-    class func keyPathsForValuesAffectingCompositStatus() -> Set<String> {
+    @objc override class func keyPathsForValuesAffectingValue(forKey key: String) -> Set<String> {
         
-        return ["state", "progress_flag"]
+        switch key {
+            
+        case #keyPath(compositStatus): return [#keyPath(state), #keyPath(progress_flag)]
+            
+        default: return []
+            
+        }
     }
     
     @objc dynamic var compositStatus: Int {