public override void Read(Library.Collections.BitStream stream, out TEnum value, MySerializeInfo info) { if (m_valueCount == 1) { value = m_firstValue; } else if (m_valueCount == 2) { value = stream.ReadBool() ? m_firstValue : m_secondValue; } else if (m_valueCount > 2) { if (HasNegativeValues) { value = MyEnum <TEnum> .SetValue((ulong)stream.ReadInt64Variant()); } else { value = MyEnum <TEnum> .SetValue(stream.ReadUInt64(m_bitCount)); } } else { value = default(TEnum); } }
public override void Read(Library.Collections.BitStream stream, out UInt64 value, MySerializeInfo info) { if (info.IsVariant || info.IsVariantSigned) { value = stream.ReadUInt64Variant(); } else { value = stream.ReadUInt64(); } }