This commit is contained in:
Kevin G Christiano 2020-01-24 13:25:59 -05:00
parent c250769620
commit 11aaedfa6b
3 changed files with 2 additions and 6 deletions

View File

@ -21,7 +21,6 @@ import Foundation
case backgroundColor case backgroundColor
case peakingUI case peakingUI
case peakingArrowColor case peakingArrowColor
case molecule
} }
required public init(from decoder: Decoder) throws { required public init(from decoder: Decoder) throws {
@ -40,6 +39,5 @@ import Foundation
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(peakingUI, forKey: .peakingUI) try container.encodeIfPresent(peakingUI, forKey: .peakingUI)
try container.encodeIfPresent(peakingArrowColor, forKey: .peakingArrowColor) try container.encodeIfPresent(peakingArrowColor, forKey: .peakingArrowColor)
try container.encodeModel(molecule, forKey: .molecule)
} }
} }

View File

@ -52,8 +52,8 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
private enum CodingKeys: String, CodingKey { private enum CodingKeys: String, CodingKey {
case moleculeName
case molecules case molecules
case molecule
case dropDown case dropDown
case line case line
case backgroundColor case backgroundColor
@ -80,6 +80,7 @@ import Foundation
public override func encode(to encoder: Encoder) throws { public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder) try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeModels2D(molecules, forKey: .molecules) try container.encodeModels2D(molecules, forKey: .molecules)
try container.encode(dropDown, forKey: .dropDown) try container.encode(dropDown, forKey: .dropDown)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)

View File

@ -21,7 +21,6 @@ import MVMCore
private enum CodingKeys: String, CodingKey { private enum CodingKeys: String, CodingKey {
case moleculeName case moleculeName
case backgroundColor case backgroundColor
case molecule
case action case action
case hideArrow case hideArrow
case line case line
@ -65,8 +64,6 @@ import MVMCore
public override func encode(to encoder: Encoder) throws { public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder) try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeModel(molecule, forKey: .molecule)
try container.encode(moleculeName, forKey: .moleculeName) try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeModelIfPresent(action, forKey: .action) try container.encodeModelIfPresent(action, forKey: .action)