[DatFile] Remove all references to Files as an independent variable

This commit is contained in:
Matt Nadareski
2016-11-08 15:50:27 -08:00
parent 82a31ed470
commit 3aa0ad3f62
12 changed files with 163 additions and 234 deletions

View File

@@ -159,21 +159,6 @@ namespace SabreTools.Helper.Dats
get { return _mergeRoms; }
set { _mergeRoms = value; }
}
protected SortedDictionary<string, List<DatItem>> Files
{
get
{
if (_files == null)
{
_files = new SortedDictionary<string, List<DatItem>>();
}
return _files;
}
set
{
_files = value;
}
}
public SortedBy SortedBy
{
get { return _sortedBy; }
@@ -431,6 +416,14 @@ namespace SabreTools.Helper.Dats
}
}
/// <summary>
/// Delete the file dictionary
/// </summary>
public void Delete()
{
_files = null;
}
/// <summary>
/// Get the keys from the file dictionary
/// </summary>
@@ -474,13 +467,30 @@ namespace SabreTools.Helper.Dats
}
}
/// <summary>
/// Reset the file dictionary
/// </summary>
public void Reset()
{
_files = new SortedDictionary<string, List<DatItem>>();
}
/// <summary>
/// Set a new file dictionary from an existing one
/// </summary>
/// <param name="newdict"></param>
public void Set(SortedDictionary<string, List<DatItem>> newdict)
{
_files = newdict;
}
#endregion
#region Cloning Methods [MODULAR DONE]
public object Clone()
{
return new DatFile
DatFile df = new DatFile
{
FileName = _fileName,
Name = _name,
@@ -502,7 +512,6 @@ namespace SabreTools.Helper.Dats
ExcludeOf = _excludeOf,
DatFormat = _datFormat,
MergeRoms = _mergeRoms,
Files = _files,
SortedBy = _sortedBy,
UseGame = _useGame,
Prefix = _prefix,
@@ -522,6 +531,9 @@ namespace SabreTools.Helper.Dats
BaddumpCount = _baddumpCount,
NodumpCount = _nodumpCount,
};
df.Set(_files);
return df;
}
public object CloneHeader()
@@ -548,7 +560,6 @@ namespace SabreTools.Helper.Dats
ExcludeOf = _excludeOf,
DatFormat = _datFormat,
MergeRoms = _mergeRoms,
Files = new SortedDictionary<string, List<DatItem>>(),
SortedBy = SortedBy.Default,
UseGame = _useGame,
Prefix = _prefix,