Exemple #1
0
 internal override bool ReadTag(NbtBinaryReader readStream)
 {
     if (readStream.Selector != null && !readStream.Selector(this)) {
         readStream.ReadByte();
         return false;
     }
     Value = readStream.ReadByte();
     return true;
 }
Exemple #2
0
 internal override bool ReadTag(NbtBinaryReader readStream)
 {
     if (readStream.Selector != null && !readStream.Selector(this))
     {
         readStream.ReadByte();
         return(false);
     }
     Value = readStream.ReadByte();
     return(true);
 }
Exemple #3
0
        void SkipValue()
        {
            // Make sure to check for "atValue" before calling this method
            switch (TagType)
            {
            case NbtTagType.Byte:
                reader.ReadByte();
                break;

            case NbtTagType.Short:
                reader.ReadInt16();
                break;

            case NbtTagType.Float:
            case NbtTagType.Int:
                reader.ReadInt32();
                break;

            case NbtTagType.Double:
            case NbtTagType.Long:
                reader.ReadInt64();
                break;

            case NbtTagType.ByteArray:
                reader.Skip(TagLength);
                break;

            case NbtTagType.IntArray:
                reader.Skip(sizeof(int) * TagLength);
                break;

            case NbtTagType.LongArray:
                reader.Skip(sizeof(long) * TagLength);
                break;

            case NbtTagType.String:
                reader.SkipString();
                break;

            default:
                throw new InvalidOperationException(NonValueTagError);
            }
            atValue    = false;
            valueCache = null;
        }
Exemple #4
0
        void SkipValue()
        {
            if (!atValue)
            {
                throw new NbtFormatException(NoValueToReadError);
            }
            switch (TagType)
            {
            case NbtTagType.Byte:
                reader.ReadByte();
                break;

            case NbtTagType.Short:
                reader.ReadInt16();
                break;

            case NbtTagType.Float:
            case NbtTagType.Int:
                reader.ReadInt32();
                break;

            case NbtTagType.Double:
            case NbtTagType.Long:
                reader.ReadInt64();
                break;

            case NbtTagType.ByteArray:
                reader.Skip(TagLength);
                break;

            case NbtTagType.IntArray:
                reader.Skip(sizeof(int) * TagLength);
                break;

            case NbtTagType.String:
                reader.SkipString();
                break;

            default:
                throw new InvalidOperationException(NonValueTagError);
            }
            atValue    = false;
            valueCache = null;
        }
Exemple #5
0
 internal override void SkipTag(NbtBinaryReader readStream)
 {
     readStream.ReadByte();
 }
Exemple #6
0
 internal override void SkipTag( NbtBinaryReader readStream )
 {
     readStream.ReadByte();
 }
Exemple #7
0
 internal override void ReadTag(NbtBinaryReader readStream)
 {
     Value = readStream.ReadByte();
 }