Ejemplo n.º 1
0
 public override void Write(Library.Collections.BitStream stream, ref Int32 value, MySerializeInfo info)
 {
     if (info.IsVariant)
     {
         stream.WriteVariant((UInt32)value);
     }
     else if (info.IsVariantSigned)
     {
         stream.WriteVariantSigned(value);
     }
     else
     {
         stream.WriteInt32(value);
     }
 }
Ejemplo n.º 2
0
        public override void Write(Library.Collections.BitStream stream, ref TEnum value, MySerializeInfo info)
        {
            ulong val = MyEnum <TEnum> .GetValue(value);

            if (m_valueCount == 2)
            {
                stream.WriteBool(val == m_firstUlong);
            }
            else if (m_valueCount > 2)
            {
                if (HasNegativeValues)
                {
                    stream.WriteVariantSigned((long)val);
                }
                else
                {
                    stream.WriteUInt64(val, m_bitCount);
                }
            }
        }