Add unit test asserting that saving, loading & saving the map produces identical output. (#348)

Also fixed PowerProvider violating this.
This commit is contained in:
Pieter-Jan Briers
2019-09-19 13:46:01 +02:00
committed by GitHub
parent 6c97b63e59
commit 35e88ea62c
3 changed files with 64 additions and 2 deletions

View File

@@ -32,6 +32,8 @@ namespace Content.Server.GameObjects.Components.Power
}
}
protected virtual bool SaveLoad => true;
/// <summary>
/// The method of draw we will try to use to place our load set via component parameter, defaults to using power providers
/// </summary>
@@ -191,8 +193,12 @@ namespace Content.Server.GameObjects.Components.Power
base.ExposeData(serializer);
serializer.DataField(ref _drawType, "drawtype", DrawTypes.Provider);
serializer.DataField(ref _load, "load", 100);
serializer.DataField(ref _priority, "priority", Powernet.Priority.Medium);
if (SaveLoad)
{
serializer.DataField(ref _load, "load", 100);
}
}
void IExamine.Examine(FormattedMessage message)