[DatItem, Machine] Remove direct usage of Machine from DatItem

This commit is contained in:
Matt Nadareski
2017-10-06 17:31:14 -07:00
parent ae01adfc6e
commit dd19501cf3
10 changed files with 582 additions and 407 deletions

View File

@@ -449,7 +449,7 @@ namespace SabreTools.Library.Dats
if ((diff & DiffMode.NoDupes) != 0)
{
DatItem newrom = item.Clone() as DatItem;
newrom.Machine.AppendName(" (" + Path.GetFileNameWithoutExtension(inputs[newrom.SystemID].Split('¬')[0]) + ")");
newrom.MachineName += " (" + Path.GetFileNameWithoutExtension(inputs[newrom.SystemID].Split('¬')[0]) + ")";
outerDiffData.Add(key, newrom);
}
@@ -462,7 +462,7 @@ namespace SabreTools.Library.Dats
if ((item.Dupe & DupeType.External) != 0)
{
DatItem newrom = item.Clone() as DatItem;
newrom.Machine.AppendName(" (" + Path.GetFileNameWithoutExtension(inputs[newrom.SystemID].Split('¬')[0]) + ")");
newrom.MachineName += " (" + Path.GetFileNameWithoutExtension(inputs[newrom.SystemID].Split('¬')[0]) + ")";
dupeData.Add(key, newrom);
}
@@ -531,9 +531,9 @@ namespace SabreTools.Library.Dats
rootpath += (rootpath == "" ? "" : Path.DirectorySeparatorChar.ToString());
filename = filename.Remove(0, rootpath.Length);
newItem.Machine.UpdateName(Path.GetDirectoryName(filename) + Path.DirectorySeparatorChar
newItem.MachineName = Path.GetDirectoryName(filename) + Path.DirectorySeparatorChar
+ Path.GetFileNameWithoutExtension(filename) + Path.DirectorySeparatorChar
+ newItem.Machine.Name);
+ newItem.MachineName;
newItems.Add(newItem);
}