public static void WritePackedULong(this DataStreamWriter writer, ulong value, NetworkCompressionModel compression) { var union = new ULongUIntUnion { LongValue = value }; writer.WritePackedUInt(union.Int0Value, compression); writer.WritePackedUInt(union.Int1Value, compression); }
public static ulong ReadPackedULongDelta(this DataStreamReader reader, ref DataStreamReader.Context ctx, ulong baseline, NetworkCompressionModel compression) { var baselineUnion = new ULongUIntUnion { LongValue = baseline }; var i1 = reader.ReadPackedUIntDelta(ref ctx, baselineUnion.Int0Value, compression); var i2 = reader.ReadPackedUIntDelta(ref ctx, baselineUnion.Int1Value, compression); return(new ULongUIntUnion { Int0Value = i1, Int1Value = i2 }.LongValue); }