Skip to main content

TypeSerializationHelper.FloatPrecisionSerialization

A class in Root.Township, the global namespace.

Meant to write a float in a range at a given precision (SyncFloat with min, max and precision), but its Serialize sends a full float and ignores those settings.

Constructors​

MemberWhat it is
FloatPrecisionSerialization(float minimum, float maximum, float precision)Creates a TypeSerializationHelper.FloatPrecisionSerialization from minimum, maximum and precision.

Fields​

3 private and internal fields
MemberWhat it is
private float maximumTop of the value range.
private float minimumBottom of the value range.
private float precisionWanted precision of the value.

Methods​

MemberWhat it is
protected override void Serialize(Type type, ref float value, Stream stream, ChunkVersioning versioning)Reads or writes a full uncompressed float. The range and precision are not used.
1 private and internal method
MemberWhat it is
private void SerializePrecision(ref float value, Stream stream)Writes the float compressed to the range and precision. Nothing calls it.