void CheckType(DebugSerializeType expectedType, int expectedBitCount) { var type = (DebugSerializeType)bitStream.ReadBits(4); var bitCount = bitStream.ReadBits(7); if (bitCount != expectedBitCount) { throw new Exception($"Expected type {expectedType} bitcount {expectedBitCount} received type {type} {bitCount}"); } if (type != expectedType) { throw new Exception($"Expected type {expectedType} received {type}"); } }
void WriteType(DebugSerializeType type, int bitCount) { // log.Debug($"Type {type} bitcount {bitCount}"); InternalWriteBits((uint)type, 4); InternalWriteBits((uint)bitCount, 7); }
public static string TypeToString(DebugSerializeType type) { return(type.ToString()); }