Lidgren.Network.NetIncomingMessage.ReadBoolean C# (CSharp) Méthode

ReadBoolean() public méthode

Reads a boolean value (stored as a single bit) written using Write(bool)
public ReadBoolean ( ) : bool
Résultat bool
        public bool ReadBoolean()
        {
            NetException.Assert(m_bitLength - m_readPosition >= 1, c_readOverflowError);
            byte retval = NetBitWriter.ReadByte(m_data, 1, m_readPosition);
            m_readPosition += 1;
            return (retval > 0 ? true : false);
        }

Usage Example

 public void Decode(NetIncomingMessage im)
 {
     this.Id = im.ReadInt32();
     this.MessageTime = im.ReadDouble();
     this.MoveUp = im.ReadBoolean();
     this.MoveDown = im.ReadBoolean();
     this.MoveLeft = im.ReadBoolean();
     this.MoveRight = im.ReadBoolean();
 }
All Usage Examples Of Lidgren.Network.NetIncomingMessage::ReadBoolean