From 557529b1e7d56fd0c95c8e6fabc63b93dfa001b5 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 14 Nov 2018 14:26:19 -0800 Subject: [PATCH] Adds support for syncing ControllerSkins --- .../Database/Model/Human/ControllerSkin.swift | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Delta/Database/Model/Human/ControllerSkin.swift b/Delta/Database/Model/Human/ControllerSkin.swift index 6d3496d..f3f4a35 100644 --- a/Delta/Database/Model/Human/ControllerSkin.swift +++ b/Delta/Database/Model/Human/ControllerSkin.swift @@ -9,6 +9,7 @@ import Foundation import DeltaCore +import Harmony extension ControllerSkinConfigurations { @@ -90,3 +91,22 @@ extension ControllerSkin: ControllerSkinProtocol return self.controllerSkin?.aspectRatio(for: traits) } } + +extension ControllerSkin: Syncable +{ + public static var syncablePrimaryKey: AnyKeyPath { + return \ControllerSkin.identifier + } + + public var syncableKeys: Set { + return [\ControllerSkin.filename, \ControllerSkin.gameType, \ControllerSkin.name, \ControllerSkin.supportedConfigurations] + } + + public var syncableFiles: Set { + return [File(identifier: "skin", fileURL: self.fileURL)] + } + + public var isSyncingEnabled: Bool { + return !self.isStandard + } +}