Filter Abstraction (#25)

* Add category, back filters by dictionary

* Complete internal filter set

* Fix AreaSize filter

* Populate filter object the hard way

* Manipulation flags should not be filters

* None of them need to be public

* Convert to partial helper method

* Better method use

* Field, not string; no dictionary

* Add FilterTo method for later

* More naming options (easier conversion)

* Update README
This commit is contained in:
Matt Nadareski
2020-07-18 21:35:17 -07:00
committed by GitHub
parent a25ffc8a36
commit 334e1c4585
21 changed files with 1551 additions and 254 deletions

View File

@@ -317,6 +317,10 @@ namespace SabreTools.Library.DatFiles
machine.Publisher = jtr.ReadAsString();
break;
case "category":
machine.Category = jtr.ReadAsString();
break;
case "romof":
machine.RomOf = jtr.ReadAsString();
break;
@@ -1023,6 +1027,11 @@ namespace SabreTools.Library.DatFiles
jtw.WritePropertyName("publisher");
jtw.WriteValue(datItem.Publisher);
}
if (!string.IsNullOrWhiteSpace(datItem.GetField(Field.Category, DatHeader.ExcludeFields)))
{
jtw.WritePropertyName("category");
jtw.WriteValue(datItem.Category);
}
if (!string.IsNullOrWhiteSpace(datItem.GetField(Field.RomOf, DatHeader.ExcludeFields)) && !string.Equals(datItem.MachineName, datItem.RomOf, StringComparison.OrdinalIgnoreCase))
{
jtw.WritePropertyName("romof");