mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Remove nearly all explict fields
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
@@ -493,6 +494,26 @@ namespace SabreTools.DatItems
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new Machine object from an existing metadata model
|
||||
/// </summary>
|
||||
/// <param name="machine">Machine metadata model</param>
|
||||
public Machine(Models.Metadata.Machine machine)
|
||||
{
|
||||
// Get all fields to automatically copy without processing
|
||||
var nonItemFields = TypeHelper.GetConstants(typeof(Models.Metadata.Machine));
|
||||
if (nonItemFields == null)
|
||||
return;
|
||||
|
||||
// Populate the internal machine from non-filter fields
|
||||
_machine = [];
|
||||
foreach (string fieldName in nonItemFields)
|
||||
{
|
||||
if (machine.ContainsKey(fieldName))
|
||||
_machine[fieldName] = machine[fieldName];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new Machine object with the included information
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user