Skip to main content

TypeSerializationHelper.FloatBitsSerialization

A class in Root.Township, the global namespace.

Writes a float packed into a range with a fixed number of bits. Used by SyncFloat with min, max and bits.

Constructors​

MemberWhat it is
FloatBitsSerialization(float minimum, float maximum, int bits)Creates a TypeSerializationHelper.FloatBitsSerialization from minimum, maximum and bits.

Fields​

3 private and internal fields
MemberWhat it is
private int bitsBits used for the value.
private float maximumTop of the value range.
private float minimumBottom of the value range.

Methods​

MemberWhat it is
protected override void Serialize(Type type, ref float value, Stream stream, ChunkVersioning versioning)Reads or writes the float compressed to bits bits between minimum and maximum.