mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Make "simple" metadata items cloneable
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
using System.Xml.Serialization;
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("analog"), XmlRoot("analog")]
|
||||
public class Analog : DatItem
|
||||
public class Analog : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -13,5 +14,15 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public Analog() => ItemType = ItemType.Analog;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new Analog();
|
||||
|
||||
obj.Mask = Mask;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("biosset"), XmlRoot("biosset")]
|
||||
public class BiosSet : DatItem
|
||||
public class BiosSet : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -18,5 +19,17 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public BiosSet() => ItemType = ItemType.BiosSet;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new BiosSet();
|
||||
|
||||
obj.Default = Default;
|
||||
obj.Description = Description;
|
||||
obj.Name = Name;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("blank"), XmlRoot("blank")]
|
||||
public class Blank : DatItem
|
||||
public class Blank : DatItem, ICloneable
|
||||
{
|
||||
public Blank() => ItemType = ItemType.Blank;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone() => new Blank();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("condition"), XmlRoot("condition")]
|
||||
public class Condition : DatItem
|
||||
public class Condition : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -20,5 +21,18 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public Condition() => ItemType = ItemType.Condition;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new Condition();
|
||||
|
||||
obj.Mask = Mask;
|
||||
obj.Relation = Relation;
|
||||
obj.Tag = Tag;
|
||||
obj.Value = Value;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("device_ref"), XmlRoot("device_ref")]
|
||||
public class DeviceRef : DatItem
|
||||
public class DeviceRef : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -13,5 +14,15 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public DeviceRef() => ItemType = ItemType.DeviceRef;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new DeviceRef();
|
||||
|
||||
obj.Name = Name;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("extension"), XmlRoot("extension")]
|
||||
public class Extension : DatItem
|
||||
public class Extension : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -13,5 +14,15 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public Extension() => ItemType = ItemType.Extension;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new Extension();
|
||||
|
||||
obj.Name = Name;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("feature"), XmlRoot("feature")]
|
||||
public class Feature : DatItem
|
||||
public class Feature : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -24,5 +25,19 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public Feature() => ItemType = ItemType.Feature;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new Feature();
|
||||
|
||||
obj.FeatureType = FeatureType;
|
||||
obj.Name = Name;
|
||||
obj.Overall = Overall;
|
||||
obj.Status = Status;
|
||||
obj.Value = Value;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("info"), XmlRoot("info")]
|
||||
public class Info : DatItem
|
||||
public class Info : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -15,5 +16,16 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public Info() => ItemType = ItemType.Info;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new Info();
|
||||
|
||||
obj.Name = Name;
|
||||
obj.Value = Value;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("instance"), XmlRoot("instance")]
|
||||
public class Instance : DatItem
|
||||
public class Instance : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -15,5 +16,16 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public Instance() => ItemType = ItemType.Instance;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new Instance();
|
||||
|
||||
obj.BriefName = BriefName;
|
||||
obj.Name = Name;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("ramoption"), XmlRoot("ramoption")]
|
||||
public class RamOption : DatItem
|
||||
public class RamOption : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -18,5 +19,17 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public RamOption() => ItemType = ItemType.RamOption;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new RamOption();
|
||||
|
||||
obj.Content = Content;
|
||||
obj.Default = Default;
|
||||
obj.Name = Name;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("sample"), XmlRoot("sample")]
|
||||
public class Sample : DatItem
|
||||
public class Sample : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -13,5 +14,15 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public Sample() => ItemType = ItemType.Sample;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new Sample();
|
||||
|
||||
obj.Name = Name;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("sharedfeat"), XmlRoot("sharedfeat")]
|
||||
public class SharedFeat : DatItem
|
||||
public class SharedFeat : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -15,5 +16,16 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public SharedFeat() => ItemType = ItemType.SharedFeat;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new SharedFeat();
|
||||
|
||||
obj.Name = Name;
|
||||
obj.Value = Value;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("slotoption"), XmlRoot("slotoption")]
|
||||
public class SlotOption : DatItem
|
||||
public class SlotOption : DatItem, ICloneable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -18,5 +19,17 @@ namespace SabreTools.Data.Models.Metadata
|
||||
#endregion
|
||||
|
||||
public SlotOption() => ItemType = ItemType.SlotOption;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new SlotOption();
|
||||
|
||||
obj.Default = Default;
|
||||
obj.DevName = DevName;
|
||||
obj.Name = Name;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user