mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFiles/] Use parent constructors
This commit is contained in:
@@ -29,12 +29,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public AttractMode(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -30,12 +30,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public ClrMamePro(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1557,9 +1557,21 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Create a new DatFile from an existing one using the header values only
|
||||
/// </summary>
|
||||
/// <param name="df"></param>
|
||||
public DatFile(DatFile datFile)
|
||||
/// <param name="cloneHeader">True if only the header should be cloned (default), false if this should be a reference to another DatFile</param>
|
||||
public DatFile(DatFile datFile, bool cloneHeader = true)
|
||||
{
|
||||
_datHeader = (DatHeader)datFile._datHeader.Clone();
|
||||
if (cloneHeader)
|
||||
{
|
||||
this._datHeader = (DatHeader)datFile._datHeader.Clone();
|
||||
}
|
||||
else
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -29,12 +29,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public DosCenter(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -33,12 +33,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
/// <param name="hash">Type of hash that is associated with this DAT</param>
|
||||
public Hashfile(DatFile datFile, Hash hash)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
_hash = hash;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,12 +30,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Listroms(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -32,12 +32,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Logiqx(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -28,12 +28,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Missfile(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -29,12 +29,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public OfflineList(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -30,12 +30,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public RomCenter(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -30,12 +30,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SabreDat(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -32,12 +32,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
/// <param name="delim">Delimiter for parsing individual lines</param>
|
||||
public SeparatedValue(DatFile datFile, char delim)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
_delim = delim;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,12 +29,8 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SoftwareList(DatFile datFile)
|
||||
: base(datFile, cloneHeader: false)
|
||||
{
|
||||
this._datHeader = datFile._datHeader;
|
||||
this._items = datFile._items;
|
||||
this._sortedBy = datFile._sortedBy;
|
||||
this._mergedBy = datFile._mergedBy;
|
||||
this._datStats = datFile._datStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user