Skip to content

Commit 3053339

Browse files
author
HolterPhylo
committed
Remove isField from SerializeMXmlValue
1 parent c8fa39d commit 3053339

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

libMBIN/Source/Template/NMSTemplate.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,9 +1192,8 @@ public byte[] SerializeBytes() {
11921192
/// <param name="field">A field.</param>
11931193
/// <param name="settings">The settings of the field.</param>
11941194
/// <param name="value">The value of the field.</param>
1195-
/// <param name="isField">NOT USED.</param>
11961195
/// <param name="IncludeTypeInfo">If true, type info is written to the MXML file.</param>
1197-
public MXmlBase SerializeMXmlValue(Type fieldType, FieldInfo field, NMSAttribute settings, object value, bool isField = true, bool IncludeTypeInfo = false)
1196+
public MXmlBase SerializeMXmlValue(Type fieldType, FieldInfo field, NMSAttribute settings, object value, bool IncludeTypeInfo)
11981197
{
11991198
string t = fieldType.Name;
12001199
int i = 0;
@@ -1290,7 +1289,7 @@ public MXmlBase SerializeMXmlValue(Type fieldType, FieldInfo field, NMSAttribute
12901289
} else {
12911290
Dictionary<string, uint> IdCounter = new Dictionary<string, uint>{};
12921291
foreach ( var template in templates ) {
1293-
MXmlProperty data = (MXmlProperty)SerializeMXmlValue( listType, field, settings, template, false, IncludeTypeInfo );
1292+
MXmlProperty data = (MXmlProperty)SerializeMXmlValue( listType, field, settings, template, IncludeTypeInfo );
12941293
data.Name = fieldName;
12951294
string typeIdField = TypeHasID(listType);
12961295
if (typeIdField != null) {
@@ -1345,7 +1344,7 @@ public MXmlBase SerializeMXmlValue(Type fieldType, FieldInfo field, NMSAttribute
13451344
string id_field = field.GetCustomAttribute<NMSAttribute>()?.KeyField ?? "";
13461345

13471346
foreach ( var template in (IEnumerable)value ) {
1348-
MXmlProperty data = (MXmlProperty)SerializeMXmlValue( hashMapType, field, settings, template, false, IncludeTypeInfo );
1347+
MXmlProperty data = (MXmlProperty)SerializeMXmlValue( hashMapType, field, settings, template, IncludeTypeInfo );
13491348

13501349
// Get aforementioned id field and write to the `_id` attribute.
13511350
MXmlProperty IdData = (MXmlProperty)data.Elements.Where(
@@ -1385,7 +1384,7 @@ public MXmlBase SerializeMXmlValue(Type fieldType, FieldInfo field, NMSAttribute
13851384
string[] names = GetEnumNames( field.Name, array.Length, settings );
13861385
i = 0;
13871386
foreach ( var template in array ) {
1388-
MXmlProperty data = (MXmlProperty)SerializeMXmlValue( arrayType, field, settings, template, false, IncludeTypeInfo );
1387+
MXmlProperty data = (MXmlProperty)SerializeMXmlValue( arrayType, field, settings, template, IncludeTypeInfo );
13891388
// Only change the name if we have an associated enum.
13901389
string overwriteName = names[i];
13911390
if (overwriteName != null && overwriteName != "") {
@@ -1515,9 +1514,9 @@ public MXmlBase SerializeMXml(bool isChildTemplate, bool isGenericTemplate = fal
15151514
if ( field.IsInitOnly ) continue;
15161515

15171516
if ( isGenericTemplate ) {
1518-
subElement.Elements.Add( SerializeMXmlValue( field.FieldType, field, settings, field.GetValue( this ), true, IncludeTypeInfo ) );
1517+
subElement.Elements.Add( SerializeMXmlValue( field.FieldType, field, settings, field.GetValue( this ), IncludeTypeInfo ) );
15191518
} else {
1520-
xmlData.Elements.Add( SerializeMXmlValue( field.FieldType, field, settings, field.GetValue( this ), true, IncludeTypeInfo ) );
1519+
xmlData.Elements.Add( SerializeMXmlValue( field.FieldType, field, settings, field.GetValue( this ), IncludeTypeInfo ) );
15211520
}
15221521
}
15231522

0 commit comments

Comments
 (0)