mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
DatItems of destiny
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using SabreTools.Library.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Permissions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Library.DatItems
|
||||
@@ -24,6 +25,42 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user