mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile, Machine] Create and use clone method
This commit is contained in:
@@ -5,7 +5,7 @@ using SabreTools.Library.Data;
|
||||
|
||||
namespace SabreTools.Library.Dats
|
||||
{
|
||||
public class Machine
|
||||
public class Machine : ICloneable
|
||||
{
|
||||
#region Protected instance variables
|
||||
|
||||
@@ -83,6 +83,35 @@ namespace SabreTools.Library.Dats
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning methods
|
||||
|
||||
/// <summary>
|
||||
/// Create a clone of the current machine
|
||||
/// </summary>
|
||||
/// <returns>New machine with the same values as the current one</returns>
|
||||
public object Clone()
|
||||
{
|
||||
return new Machine()
|
||||
{
|
||||
Name = this.Name,
|
||||
Comment = this.Comment,
|
||||
Description = this.Description,
|
||||
Year = this.Year,
|
||||
Manufacturer = this.Manufacturer,
|
||||
RomOf = this.RomOf,
|
||||
CloneOf = this.CloneOf,
|
||||
SampleOf = this.SampleOf,
|
||||
SourceFile = this.SourceFile,
|
||||
Runnable = this.Runnable,
|
||||
Board = this.Board,
|
||||
RebuildTo = this.RebuildTo,
|
||||
Devices = this.Devices,
|
||||
MachineType = this.MachineType,
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Equality comparerers
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user