Esempio n. 1
0
 public override void Write(Stream output)
 {
     output.WriteByte((byte)Type);
     TagString.WriteString(output, Name);
     TagInt.WriteInt(output, Value);
 }
Esempio n. 2
0
 public TagInt(Stream input)
 {
     Name  = TagString.ReadString(input);
     Value = ReadInt(input);
 }
Esempio n. 3
0
 public TagFloat(Stream input)
 {
     Name  = TagString.ReadString(input);
     Value = ReadFloat(input);
 }
Esempio n. 4
0
        internal static List <AbstractTag> ReadTagList(Stream input)
        {
            TagType tagType = (TagType)TagByte.ReadByte(input);
            int     length  = TagInt.ReadInt(input);

            List <AbstractTag> tags = new List <AbstractTag>();

            for (int i = 0; i < length; i++)
            {
                AbstractTag tag = null;

                switch (tagType)
                {
                case TagType.Byte:
                    tag = TagByte.ReadUnnamedTagByte(input);
                    break;

                case TagType.ByteArray:
                    tag = TagByteArray.ReadUnnamedTagByteArray(input);
                    break;

                case TagType.Compound:
                    tag = TagCompound.ReadUnnamedTagCompound(input);
                    break;

                case TagType.Double:
                    tag = TagDouble.ReadUnnamedTagDouble(input);
                    break;

                case TagType.End:
                    tag = new TagEnd();
                    break;

                case TagType.Float:
                    tag = TagFloat.ReadUnnamedTagFloat(input);
                    break;

                case TagType.Int:
                    tag = TagInt.ReadUnnamedTagInt(input);
                    break;

                case TagType.IntArray:
                    tag = TagIntArray.ReadUnnamedTagIntArray(input);
                    break;

                case TagType.List:
                    tag = TagList.ReadUnnamedTagList(input);
                    break;

                case TagType.Long:
                    tag = TagLong.ReadUnnamedTagLong(input);
                    break;

                case TagType.Short:
                    tag = TagShort.ReadUnnamedTagShort(input);
                    break;

                case TagType.String:
                    tag = TagString.ReadUnnamedTagString(input);
                    break;

                default:
                    tag = null;
                    break;
                }

                if (tag != null)
                {
                    tags.Add(tag);
                }
            }

            return(tags);
        }
Esempio n. 5
0
 public TagByteArray(Stream input)
 {
     Name  = TagString.ReadString(input);
     Value = ReadByteArray(input);
 }
Esempio n. 6
0
 public TagByte(Stream decompressedInput)
 {
     Name  = TagString.ReadString(decompressedInput);
     Value = ReadByte(decompressedInput);
 }
Esempio n. 7
0
 public TagLong(Stream input)
 {
     Name  = TagString.ReadString(input);
     Value = ReadLong(input);
 }
Esempio n. 8
0
 public TagCompound(Stream input)
 {
     Name        = TagString.ReadString(input);
     _dictionary = ReadDictionary(input);
 }
Esempio n. 9
0
 public override void Write(Stream output)
 {
     output.WriteByte((byte)Type);
     TagString.WriteString(output, Name);
     TagCompound.WriteCompound(output, this);
 }
Esempio n. 10
0
 public TagDouble(Stream input)
 {
     Name  = TagString.ReadString(input);
     Value = ReadDouble(input);
 }
Esempio n. 11
0
 public override void Write(System.IO.Stream output)
 {
     output.WriteByte((byte)Type);
     TagString.WriteString(output, Name);
     TagIntArray.WriteIntArray(output, Value);
 }