/// <summary>Construct an instance.</summary> /// <param name="other">The other instance to copy.</param> public PatchConfig(PatchConfig other) { // all actions this.LogName = other.LogName; this.Action = other.Action; this.Target = other.Target; this.Update = other.Update; this.FromFile = other.FromFile; this.Enabled = other.Enabled; this.When = other.When.Clone(); // multiple actions this.TextOperations = other.TextOperations.Select(p => new TextOperationConfig(p)).ToArray(); // EditImage this.FromArea = other.FromArea != null ? new PatchRectangleConfig(other.FromArea) : null; this.ToArea = other.ToArea != null ? new PatchRectangleConfig(other.ToArea) : null; this.PatchMode = other.PatchMode; // EditData this.Entries = other.Entries.Clone(value => value?.DeepClone()); this.Fields = other.Fields.Clone( entryFields => entryFields?.Clone(value => value?.DeepClone()) ); this.MoveEntries = other.MoveEntries.Select(p => new PatchMoveEntryConfig(p)).ToArray(); // EditMap this.MapProperties = other.MapProperties.Clone(); this.MapTiles = other.MapTiles.Select(p => new PatchMapTileConfig(p)).ToArray(); }
/// <summary>Construct an instance.</summary> /// <param name="other">The other instance to copy.</param> public PatchConfig(PatchConfig other) { // all actions this.LogName = other.LogName; this.Action = other.Action; this.Target = other.Target; this.Update = other.Update; this.FromFile = other.FromFile; this.Enabled = other.Enabled; this.When = other.When != null ? new InvariantDictionary <string>(other.When) : null; // multiple actions this.TextOperations = other.TextOperations?.Select(p => new TextOperationConfig(p)).ToArray(); // EditImage this.FromArea = other.FromArea != null ? new PatchRectangleConfig(other.FromArea) : null; this.ToArea = other.ToArea != null ? new PatchRectangleConfig(other.ToArea) : null; this.PatchMode = other.PatchMode; // EditData this.Entries = other.Entries?.ToDictionary(p => p.Key, p => p.Value); this.Fields = other.Fields?.ToDictionary(p => p.Key, p => p.Value); this.MoveEntries = other.MoveEntries?.Select(p => new PatchMoveEntryConfig(p)).ToArray(); // EditMap this.MapProperties = other.MapProperties?.ToDictionary(p => p.Key, p => p.Value); this.MapTiles = other.MapTiles?.Select(p => new PatchMapTileConfig(p)).ToArray(); }
/// <summary>Construct an instance.</summary> /// <param name="other">The other patch to clone.</param> public PatchConfig(PatchConfig other) { this.LogName = other.LogName; this.Action = other.Action; this.Target = other.Target; this.Enabled = other.Enabled; this.When = other.When != null ? new InvariantDictionary <string>(other.When) : null; this.FromFile = other.FromFile; this.FromArea = other.FromArea; this.ToArea = other.ToArea; this.PatchMode = other.PatchMode; this.Entries = other.Entries != null ? new Dictionary <string, JToken>(other.Entries) : null; this.Fields = other.Fields != null ? new Dictionary <string, IDictionary <string, JToken> >(other.Fields) : null; }
/// <summary>Construct an instance.</summary> /// <param name="other">The other instance to copy.</param> public PatchConfig(PatchConfig other) { this.LogName = other.LogName; this.Action = other.Action; this.Target = other.Target; this.Enabled = other.Enabled; this.When = other.When != null ? new InvariantDictionary <string>(other.When) : null; this.FromFile = other.FromFile; this.FromArea = other.FromArea; this.ToArea = other.ToArea; this.PatchMode = other.PatchMode; this.Entries = other.Entries?.ToDictionary(p => p.Key, p => p.Value); this.Fields = other.Fields?.ToDictionary(p => p.Key, p => p.Value); this.MoveEntries = other.MoveEntries?.Select(p => new PatchMoveEntryConfig(p)).ToArray(); }