Start implementing internal header processing

This commit is contained in:
Matt Nadareski
2024-03-10 22:49:15 -04:00
parent 962fd8baee
commit 51ce358e6f
12 changed files with 114 additions and 37 deletions

View File

@@ -112,6 +112,28 @@ namespace SabreTools.DatFiles
#region Instance Methods
#region Constructors
public DatHeader() { }
public DatHeader(Models.Metadata.Header header)
{
// Get all fields to automatically copy without processing
var nonItemFields = TypeHelper.GetConstants(typeof(Models.Metadata.Header));
if (nonItemFields == null)
return;
// Populate the internal machine from non-filter fields
_header = [];
foreach (string fieldName in nonItemFields)
{
if (header.ContainsKey(fieldName))
_header[fieldName] = header[fieldName];
}
}
#endregion
#region Accessors
/// <summary>