mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
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:
@@ -174,6 +174,10 @@ namespace SabreTools.Library.DatFiles
|
||||
machine.Publisher = reader.ReadElementContentAsString();
|
||||
break;
|
||||
|
||||
case "category":
|
||||
machine.Category = reader.ReadElementContentAsString();
|
||||
break;
|
||||
|
||||
case "info":
|
||||
machine.Infos.Add(new KeyValuePair<string, string>(reader.GetAttribute("name"), reader.GetAttribute("value")));
|
||||
reader.Read();
|
||||
@@ -717,6 +721,8 @@ namespace SabreTools.Library.DatFiles
|
||||
xtw.WriteElementString("year", datItem.Year);
|
||||
if (!string.IsNullOrWhiteSpace(datItem.GetField(Field.Publisher, DatHeader.ExcludeFields)))
|
||||
xtw.WriteElementString("publisher", datItem.Publisher);
|
||||
if (!string.IsNullOrWhiteSpace(datItem.GetField(Field.Category, DatHeader.ExcludeFields)))
|
||||
xtw.WriteElementString("category", datItem.Category);
|
||||
|
||||
if (!DatHeader.ExcludeFields[(int)Field.Infos] && datItem.Infos != null && datItem.Infos.Count > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user