Exemple #1
0
        private static bool DecodeSpecialFloat(BitBuffer bitBuffer, CSVCMsgSendTable.SendpropT prop, out float val)
        {
            val = default(float);

            var flags = (SendPropFlag)prop.Flags;

            if ((flags & SendPropFlag.COORD) != 0)
            {
                val = bitBuffer.ReadBitCoord();
                return(true);
            }

            if ((flags & SendPropFlag.COORD_MP) != 0)
            {
                val = bitBuffer.ReadBitCoordMP(BitCoordType.None);
                return(true);
            }

            if ((flags & SendPropFlag.COORD_MP_LOWPRECISION) != 0)
            {
                val = bitBuffer.ReadBitCoordMP(BitCoordType.LowPrecision);
                return(true);
            }

            if ((flags & SendPropFlag.CELL_COORD_INTEGRAL) != 0)
            {
                val = bitBuffer.ReadBitCoordMP(BitCoordType.Integral);
                return(true);
            }

            if ((flags & SendPropFlag.NOSCALE) != 0)
            {
                val = bitBuffer.ReadBitFloat();
                return(true);
            }

            if ((flags & SendPropFlag.NORMAL) != 0)
            {
                val = bitBuffer.ReadBitNormal();
                return(true);
            }

            if ((flags & SendPropFlag.CELL_COORD) != 0)
            {
                val = bitBuffer.ReadBitCellCoord(prop.NumBits, BitCoordType.None);
                return(true);
            }

            if ((flags & SendPropFlag.CELL_COORD_LOWPRECISION) != 0)
            {
                val = bitBuffer.ReadBitCellCoord(prop.NumBits, BitCoordType.LowPrecision);
                return(true);
            }

            if ((flags & SendPropFlag.CELL_COORD_INTEGRAL) != 0)
            {
                val = bitBuffer.ReadBitCellCoord(prop.NumBits, BitCoordType.Integral);
                return(true);
            }

            return(false);
        }