Add explicit list of supported types

This commit is contained in:
Matt Nadareski
2020-09-18 17:12:31 -07:00
parent 5a8ff006bd
commit ae3bae2d0a
14 changed files with 138 additions and 1 deletions

View File

@@ -2339,7 +2339,6 @@ namespace SabreTools.Library.DatFiles
#endregion
// TODO: See if any of the helper methods can be broken up a bit more neatly
#region Rebuilding and Verifying
/// <summary>
@@ -3777,6 +3776,15 @@ namespace SabreTools.Library.DatFiles
return rom;
}
/// <summary>
/// Get supported types for write
/// </summary>
/// <returns>List of supported types for writing</returns>
protected virtual ItemType[] GetSupportedTypes()
{
return Enum.GetValues(typeof(ItemType)) as ItemType[];
}
/// <summary>
/// Get if an item should be ignored on write
/// </summary>
@@ -3803,6 +3811,10 @@ namespace SabreTools.Library.DatFiles
return true;
}
// If we have an item type not in the list of supported values
if (!GetSupportedTypes().Contains(datItem.ItemType))
return true;
return false;
}