Remove unnecessary Field exclusion

This commit is contained in:
Matt Nadareski
2020-08-23 22:23:55 -07:00
parent a1d81a8e5f
commit f8fae70231
27 changed files with 618 additions and 958 deletions

View File

@@ -1,15 +1,16 @@
using System.Collections.Generic;
using System.Linq;
using SabreTools.Library.Filtering;
using Newtonsoft.Json;
using System.Linq;
using SabreTools.Library.Tools;
using Newtonsoft.Json;
namespace SabreTools.Library.DatItems
{
/// <summary>
/// Represents which BIOS(es) is associated with a set
/// </summary>
[JsonObject("biosset")]
public class BiosSet : DatItem
{
#region Fields
@@ -30,38 +31,6 @@ namespace SabreTools.Library.DatItems
#region Accessors
/// <summary>
/// Get the value of that field as a string, if possible
/// </summary>
public override string GetField(Field field, List<Field> excludeFields)
{
// If the field is to be excluded, return empty string
if (excludeFields.Contains(field))
return string.Empty;
// Handle BiosSet-specific fields
string fieldValue;
switch (field)
{
case Field.Default:
fieldValue = Default?.ToString();
break;
case Field.BiosDescription:
fieldValue = Description;
break;
// For everything else, use the base method
default:
return base.GetField(field, excludeFields);
}
// Make sure we don't return null
if (string.IsNullOrEmpty(fieldValue))
fieldValue = string.Empty;
return fieldValue;
}
/// <summary>
/// Set fields with given values
/// </summary>