Promote DataArea, DiskArea, and Part

This commit is contained in:
Matt Nadareski
2020-09-04 14:10:35 -07:00
parent a416064bc0
commit 40ca4e39a5
14 changed files with 1011 additions and 445 deletions

View File

@@ -51,11 +51,11 @@ namespace SabreTools.Library.DatItems
base.SetFields(mappings);
// Handle PartFeature-specific fields
if (mappings.Keys.Contains(Field.DatItem_Name))
Name = mappings[Field.DatItem_Name];
if (mappings.Keys.Contains(Field.DatItem_Part_Feature_Name))
Name = mappings[Field.DatItem_Part_Feature_Name];
if (mappings.Keys.Contains(Field.DatItem_Value))
Value = mappings[Field.DatItem_Value];
if (mappings.Keys.Contains(Field.DatItem_Part_Feature_Value))
Value = mappings[Field.DatItem_Part_Feature_Value];
}
#endregion
@@ -151,15 +151,15 @@ namespace SabreTools.Library.DatItems
return false;
// Filter on item name
if (filter.DatItem_Name.MatchesPositiveSet(Name) == false)
if (filter.DatItem_Part_Feature_Name.MatchesPositiveSet(Name) == false)
return false;
if (filter.DatItem_Name.MatchesNegativeSet(Name) == true)
if (filter.DatItem_Part_Feature_Name.MatchesNegativeSet(Name) == true)
return false;
// Filter on info value
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
if (filter.DatItem_Part_Feature_Value.MatchesPositiveSet(Value) == false)
return false;
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
if (filter.DatItem_Part_Feature_Value.MatchesNegativeSet(Value) == true)
return false;
return true;
@@ -175,10 +175,10 @@ namespace SabreTools.Library.DatItems
base.RemoveFields(fields);
// Remove the fields
if (fields.Contains(Field.DatItem_Name))
if (fields.Contains(Field.DatItem_Part_Feature_Name))
Name = null;
if (fields.Contains(Field.DatItem_Value))
if (fields.Contains(Field.DatItem_Part_Feature_Value))
Value = null;
}
@@ -214,10 +214,10 @@ namespace SabreTools.Library.DatItems
PartFeature newItem = item as PartFeature;
// Replace the fields
if (fields.Contains(Field.DatItem_Name))
if (fields.Contains(Field.DatItem_Part_Feature_Name))
Name = newItem.Name;
if (fields.Contains(Field.DatItem_Value))
if (fields.Contains(Field.DatItem_Part_Feature_Value))
Value = newItem.Value;
}