コード例 #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;
             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");
     }
 }