Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 public override void Read(Library.Collections.BitStream stream, out Int64 value, MySerializeInfo info)
 {
     if (info.IsVariant)
     {
         value = (Int64)stream.ReadUInt64Variant();
     }
     else if (info.IsVariantSigned)
     {
         value = stream.ReadInt64Variant();
     }
     else
     {
         value = stream.ReadInt64();
     }
 }