Adds support for syncing SaveStates
This commit is contained in:
parent
f858a3eb07
commit
fb9272cd6c
@ -9,6 +9,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
import DeltaCore
|
import DeltaCore
|
||||||
|
import Harmony
|
||||||
|
|
||||||
@objc public enum SaveStateType: Int16
|
@objc public enum SaveStateType: Int16
|
||||||
{
|
{
|
||||||
@ -90,3 +91,26 @@ public class SaveState: _SaveState, SaveStateProtocol
|
|||||||
return fetchRequest
|
return fetchRequest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension SaveState: Syncable
|
||||||
|
{
|
||||||
|
public static var syncablePrimaryKey: AnyKeyPath {
|
||||||
|
return \SaveState.identifier
|
||||||
|
}
|
||||||
|
|
||||||
|
public var syncableKeys: Set<AnyKeyPath> {
|
||||||
|
return [\SaveState.creationDate, \SaveState.filename, \SaveState.modifiedDate, \SaveState.name, \SaveState.type]
|
||||||
|
}
|
||||||
|
|
||||||
|
public var syncableFiles: Set<File> {
|
||||||
|
return [File(identifier: "saveState", fileURL: self.fileURL), File(identifier: "thumbnail", fileURL: self.imageFileURL)]
|
||||||
|
}
|
||||||
|
|
||||||
|
public var syncableRelationships: Set<AnyKeyPath> {
|
||||||
|
return [\SaveState.game]
|
||||||
|
}
|
||||||
|
|
||||||
|
public var isSyncingEnabled: Bool {
|
||||||
|
return self.type != .auto && self.type != .quick
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
2
External/Harmony
vendored
2
External/Harmony
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 47cc6cd87cd7e04765b05204a03f83c9eab7c159
|
Subproject commit ee45cd9ff3ff6c50c29e85cd466c4031108c3fde
|
||||||
Loading…
Reference in New Issue
Block a user