Add SaveLoadSavePrototype test (#18859)

This commit is contained in:
Leon Friedrich
2023-08-08 19:27:16 +12:00
committed by GitHub
parent b345625de9
commit 6982f238e8
16 changed files with 272 additions and 117 deletions

View File

@@ -248,7 +248,12 @@ namespace Content.Shared.FixedPoint
public void Deserialize(string value)
{
Value = FromFloat(FloatFromString(value));
// TODO implement "lossless" serializer.
// I.e., dont use floats.
if (value == "MaxValue")
Value = int.MaxValue;
else
Value = FromFloat(FloatFromString(value));
}
public override readonly string ToString() => $"{ShiftDown().ToString(CultureInfo.InvariantCulture)}";
@@ -260,6 +265,11 @@ namespace Content.Shared.FixedPoint
public readonly string Serialize()
{
// TODO implement "lossless" serializer.
// I.e., dont use floats.
if (Value == int.MaxValue)
return "MaxValue";
return ToString();
}