diff --git a/Delta/Database/Model/Delta.xcdatamodeld/Delta 2.xcdatamodel/contents b/Delta/Database/Model/Delta.xcdatamodeld/Delta 2.xcdatamodel/contents
index 0a25f33..5fe9151 100644
--- a/Delta/Database/Model/Delta.xcdatamodeld/Delta 2.xcdatamodel/contents
+++ b/Delta/Database/Model/Delta.xcdatamodeld/Delta 2.xcdatamodel/contents
@@ -96,6 +96,7 @@
+
@@ -103,6 +104,9 @@
+
+
+
@@ -133,7 +137,7 @@
-
+
\ No newline at end of file
diff --git a/Delta/Database/Model/Human/GameControllerInputMapping.swift b/Delta/Database/Model/Human/GameControllerInputMapping.swift
index 0a71b27..03793ab 100644
--- a/Delta/Database/Model/Human/GameControllerInputMapping.swift
+++ b/Delta/Database/Model/Human/GameControllerInputMapping.swift
@@ -9,6 +9,7 @@
import Foundation
import DeltaCore
+import Harmony
@objc(GameControllerInputMapping)
public class GameControllerInputMapping: _GameControllerInputMapping
@@ -24,6 +25,13 @@ public class GameControllerInputMapping: _GameControllerInputMapping
self.inputMapping = inputMapping
}
+
+ public override func awakeFromInsert()
+ {
+ super.awakeFromInsert()
+
+ self.identifier = UUID().uuidString
+ }
}
extension GameControllerInputMapping
@@ -75,3 +83,17 @@ extension GameControllerInputMapping: GameControllerInputMappingProtocol
self.inputMapping.set(input, forControllerInput: controllerInput)
}
}
+
+extension GameControllerInputMapping: Syncable
+{
+ public static var syncablePrimaryKey: AnyKeyPath {
+ return \GameControllerInputMapping.identifier
+ }
+
+ public var syncableKeys: Set {
+ return [\GameControllerInputMapping.deltaCoreInputMapping,
+ \GameControllerInputMapping.gameControllerInputType,
+ \GameControllerInputMapping.gameType,
+ \GameControllerInputMapping.playerIndex]
+ }
+}
diff --git a/Delta/Database/Model/Machine/_GameControllerInputMapping.swift b/Delta/Database/Model/Machine/_GameControllerInputMapping.swift
index cc28acb..7f6d159 100644
--- a/Delta/Database/Model/Machine/_GameControllerInputMapping.swift
+++ b/Delta/Database/Model/Machine/_GameControllerInputMapping.swift
@@ -20,6 +20,8 @@ public class _GameControllerInputMapping: NSManagedObject
@NSManaged public var gameType: GameType
+ @NSManaged public var identifier: String
+
@NSManaged public var playerIndex: Int16
// MARK: - Relationships
diff --git a/External/Harmony b/External/Harmony
index ee45cd9..2c8aed1 160000
--- a/External/Harmony
+++ b/External/Harmony
@@ -1 +1 @@
-Subproject commit ee45cd9ff3ff6c50c29e85cd466c4031108c3fde
+Subproject commit 2c8aed14f6287e45eb3c32017de590ec4323e64f