using System; using System.Collections.Generic; using SabreTools.Library.Data; namespace SabreTools.Library.DatItems { /// /// Represents the information specific to a set/game/machine /// public class Machine : ICloneable { #region Publicly facing variables /// /// Name of the machine /// public string Name { get; set; } /// /// Additional notes /// public string Comment { get; set; } /// /// Extended description /// public string Description { get; set; } /// /// Year(s) of release/manufacture /// public string Year { get; set; } /// /// Manufacturer, if available /// public string Manufacturer { get; set; } /// /// Publisher, if available /// public string Publisher { get; set; } /// /// fomof parent /// public string RomOf { get; set; } /// /// cloneof parent /// public string CloneOf { get; set; } /// /// sampleof parent /// public string SampleOf { get; set; } /// /// Support status /// /// yes = true, partial = null, no = false public bool? Supported { get; set; } /// /// Emulator source file related to the machine /// public string SourceFile { get; set; } /// /// Machine runnable status /// /// yes = true, partial = null, no = false public bool? Runnable { get; set; } /// /// Machine board name /// public string Board { get; set; } /// /// Rebuild location if different than machine name /// public string RebuildTo { get; set; } /// /// List of associated device names /// public List Devices { get; set; } /// /// List of slot options /// public List SlotOptions { get; set; } /// /// List of info items /// public List> Infos { get; set; } /// /// Type of the machine /// public MachineType MachineType { get; set; } #endregion #region Constructors /// /// Create a new Machine object /// public Machine() { Name = null; Comment = null; Description = null; Year = null; Manufacturer = null; Publisher = null; RomOf = null; CloneOf = null; SampleOf = null; Supported = true; SourceFile = null; Runnable = null; Board = null; RebuildTo = null; Devices = null; SlotOptions = null; Infos = null; MachineType = MachineType.NULL; } /// /// Create a new Machine object with the included information /// /// Name of the machine /// Description of the machine public Machine(string name, string description) { Name = name; Comment = null; Description = description; Year = null; Manufacturer = null; Publisher = null; RomOf = null; CloneOf = null; SampleOf = null; Supported = true; SourceFile = null; Runnable = null; Board = null; RebuildTo = null; Devices = null; SlotOptions = null; Infos = null; MachineType = MachineType.NULL; } #endregion #region Cloning methods /// /// Create a clone of the current machine /// /// New machine with the same values as the current one public object Clone() { return new Machine() { Name = this.Name, Comment = this.Comment, Description = this.Description, Year = this.Year, Manufacturer = this.Manufacturer, Publisher = this.Publisher, RomOf = this.RomOf, CloneOf = this.CloneOf, SampleOf = this.SampleOf, Supported = this.Supported, SourceFile = this.SourceFile, Runnable = this.Runnable, Board = this.Board, RebuildTo = this.RebuildTo, Devices = this.Devices, SlotOptions = this.SlotOptions, Infos = this.Infos, MachineType = this.MachineType, }; } #endregion } }