Example #1
0
        public void ParseValue(GameBitBuffer buffer)
        {
            switch (Attribute.EncodingType)
            {
            case GameAttributeEncoding.Int:
                Int = buffer.ReadInt(Attribute.BitCount);
                break;

            case GameAttributeEncoding.IntMinMax:
                Int = buffer.ReadInt(Attribute.BitCount) + Attribute.Min.Value;
                break;

            case GameAttributeEncoding.Float16:
                Float = buffer.ReadFloat16();
                break;

            case GameAttributeEncoding.Float16Or32:
                Float = buffer.ReadBool() ? buffer.ReadFloat16() : buffer.ReadFloat32();
                break;

            case GameAttributeEncoding.Float32:
                Float = buffer.ReadFloat32();
                break;

            default:
                throw new Exception("bad voodoo");
            }
        }
Example #2
0
 public void ParseValue(GameBitBuffer buffer)
 {
     switch (Attribute.EncodingType)
     {
         case GameAttributeEncoding.Int:
             Int = buffer.ReadInt(Attribute.BitCount);
             break;
         case GameAttributeEncoding.IntMinMax:
             Int = buffer.ReadInt(Attribute.BitCount) + Attribute.Min.Value;
             break;
         case GameAttributeEncoding.Float16:
             Float = buffer.ReadFloat16();
             break;
         case GameAttributeEncoding.Float16Or32:
             Float = buffer.ReadBool() ? buffer.ReadFloat16() : buffer.ReadFloat32();
             break;
         default:
             throw new Exception("bad voodoo");
     }
 }