mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add constructors for internal models
This commit is contained in:
@@ -48,6 +48,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Adjuster;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an Adjuster object from the internal model
|
||||
/// </summary>
|
||||
public Adjuster(Models.Metadata.Adjuster? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Adjuster;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -23,6 +23,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Analog;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an Analog object from the internal model
|
||||
/// </summary>
|
||||
public Analog(Models.Metadata.Analog? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Analog;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.BiosSet;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a BiosSet object from the internal model
|
||||
/// </summary>
|
||||
public BiosSet(Models.Metadata.BiosSet? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.BiosSet;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Chip;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Chip object from the internal model
|
||||
/// </summary>
|
||||
public Chip(Models.Metadata.Chip? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Chip;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -23,6 +23,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Condition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Condition object from the internal model
|
||||
/// </summary>
|
||||
public Condition(Models.Metadata.Condition? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Condition;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.ConfLocation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a ConfLocation object from the internal model
|
||||
/// </summary>
|
||||
public ConfLocation(Models.Metadata.ConfLocation? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.ConfLocation;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -48,6 +48,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.ConfSetting;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a ConfSetting object from the internal model
|
||||
/// </summary>
|
||||
public ConfSetting(Models.Metadata.ConfSetting? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.ConfSetting;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -68,6 +68,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Configuration object from the internal model
|
||||
/// </summary>
|
||||
public Configuration(Models.Metadata.Configuration? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Configuration;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -23,6 +23,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Control;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Control object from the internal model
|
||||
/// </summary>
|
||||
public Control(Models.Metadata.Control? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Control;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -35,6 +35,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.DataArea;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a DataArea object from the internal model
|
||||
/// </summary>
|
||||
public DataArea(Models.Metadata.DataArea? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.DataArea;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -47,6 +47,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Device;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Device object from the internal model
|
||||
/// </summary>
|
||||
public Device(Models.Metadata.Device? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Device;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.DeviceReference;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a DeviceReference object from the internal model
|
||||
/// </summary>
|
||||
public DeviceReference(Models.Metadata.DeviceRef? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.DeviceReference;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.DipLocation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a DipLocation object from the internal model
|
||||
/// </summary>
|
||||
public DipLocation(Models.Metadata.DipLocation? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.DipLocation;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -80,6 +80,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.DipSwitch;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a DipSwitch object from the internal model
|
||||
/// </summary>
|
||||
public DipSwitch(Models.Metadata.DipSwitch? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.DipSwitch;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -48,6 +48,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.DipValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a DipValue object from the internal model
|
||||
/// </summary>
|
||||
public DipValue(Models.Metadata.DipValue? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.DipValue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -81,6 +81,17 @@ namespace SabreTools.DatItems.Formats
|
||||
SetFieldValue<ItemStatus>(Models.Metadata.Disk.StatusKey, ItemStatus.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Disk object from the internal model
|
||||
/// </summary>
|
||||
public Disk(Models.Metadata.Disk? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Disk;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -35,6 +35,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.DiskArea;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a DiskArea object from the internal model
|
||||
/// </summary>
|
||||
public DiskArea(Models.Metadata.DiskArea? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.DiskArea;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -23,6 +23,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Display;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Display object from the internal model
|
||||
/// </summary>
|
||||
public Display(Models.Metadata.Display? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Display;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -26,6 +26,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Driver;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Driver object from the internal model
|
||||
/// </summary>
|
||||
public Driver(Models.Metadata.Driver? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Driver;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Extension;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an Extension object from the internal model
|
||||
/// </summary>
|
||||
public Extension(Models.Metadata.Extension? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Extension;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -23,6 +23,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Feature;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Feature object from the internal model
|
||||
/// </summary>
|
||||
public Feature(Models.Metadata.Feature? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Feature;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Info;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an Info object from the internal model
|
||||
/// </summary>
|
||||
public Info(Models.Metadata.Info? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Info;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -37,6 +37,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Input;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an Input object from the internal model
|
||||
/// </summary>
|
||||
public Input(Models.Metadata.Input? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Input;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an Instance object from the internal model
|
||||
/// </summary>
|
||||
public Instance(Models.Metadata.Instance? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Instance;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -37,6 +37,18 @@ namespace SabreTools.DatItems.Formats
|
||||
DupeType = 0x00;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Media object from the internal model
|
||||
/// </summary>
|
||||
public Media(Models.Metadata.Media? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Media;
|
||||
DupeType = 0x00;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Media object from a BaseFile
|
||||
/// </summary>
|
||||
|
||||
@@ -49,6 +49,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Part;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Part object from the internal model
|
||||
/// </summary>
|
||||
public Part(Models.Metadata.Part? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Part;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.PartFeature;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a PartFeature object from the internal model
|
||||
/// </summary>
|
||||
public PartFeature(Models.Metadata.Feature? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.PartFeature;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -37,6 +37,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Port;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Port object from the internal model
|
||||
/// </summary>
|
||||
public Port(Models.Metadata.Port? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Port;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.RamOption;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a RamOption object from the internal model
|
||||
/// </summary>
|
||||
public RamOption(Models.Metadata.RamOption? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.RamOption;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Release;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Release object from the internal model
|
||||
/// </summary>
|
||||
public Release(Models.Metadata.Release? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Release;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -137,13 +137,13 @@ namespace SabreTools.DatItems.Formats
|
||||
/// <summary>
|
||||
/// Create a Rom object from the internal model
|
||||
/// </summary>
|
||||
public Rom(Models.Metadata.Rom? rom)
|
||||
public Rom(Models.Metadata.Rom? item)
|
||||
{
|
||||
_internal = rom ?? [];
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Rom;
|
||||
DupeType = 0x00;
|
||||
SetFieldValue<ItemStatus>(Models.Metadata.Rom.StatusKey, ItemStatus.None);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Sample;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Sample object from the internal model
|
||||
/// </summary>
|
||||
public Sample(Models.Metadata.Sample? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Sample;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.SharedFeature;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a SharedFeature object from the internal model
|
||||
/// </summary>
|
||||
public SharedFeature(Models.Metadata.SharedFeat? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.SharedFeature;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -48,6 +48,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Slot;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Slot object from the internal model
|
||||
/// </summary>
|
||||
public Slot(Models.Metadata.Slot? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Slot;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -34,6 +34,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.SlotOption;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a SlotOption object from the internal model
|
||||
/// </summary>
|
||||
public SlotOption(Models.Metadata.SlotOption? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.SlotOption;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -37,6 +37,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.SoftwareList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a SoftwareList object from the internal model
|
||||
/// </summary>
|
||||
public SoftwareList(Models.Metadata.SoftwareList? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.SoftwareList;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
@@ -23,6 +23,17 @@ namespace SabreTools.DatItems.Formats
|
||||
ItemType = ItemType.Sound;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Sound object from the internal model
|
||||
/// </summary>
|
||||
public Sound(Models.Metadata.Sound? item)
|
||||
{
|
||||
_internal = item ?? [];
|
||||
Machine = new Machine();
|
||||
|
||||
ItemType = ItemType.Sound;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
Reference in New Issue
Block a user