예제 #1
0
 public TAG_List(TAG[] payload, Byte tagId)
     : this()
 {
     TagId   = new TAG_Byte(tagId);
     Length  = new TAG_Int(payload.Length);
     Payload = payload;
 }
예제 #2
0
 public TAG_List()
 {
     TagId   = null;
     Length  = null;
     Payload = null;
     Type    = TYPE.TAG_List;
 }
예제 #3
0
파일: Tag.cs 프로젝트: mblaine/NbtViewer
        public override void Read(Stream data)
        {
            TagId = new TAG_Byte();
            TagId.Read(data);

            Length = new TAG_Int();
            Length.Read(data);

            Payload = new TAG[Length.Payload];
            for (Int32 i = 0; i < Length.Payload; i++)
            {
                switch ((TYPE)TagId.Payload)
                {
                    case TYPE.TAG_Byte:
                        Payload[i] = (TAG)new TAG_Byte(data);
                        break;
                    case TYPE.TAG_Short:
                        Payload[i] = (TAG)new TAG_Short(data);
                        break;
                    case TYPE.TAG_Int:
                        Payload[i] = (TAG)new TAG_Int(data);
                        break;
                    case TYPE.TAG_Long:
                        Payload[i] = (TAG)new TAG_Long(data);
                        break;
                    case TYPE.TAG_Float:
                        Payload[i] = (TAG)new TAG_Float(data);
                        break;
                    case TYPE.TAG_Double:
                        Payload[i] = (TAG)new TAG_Double(data);
                        break;
                    case TYPE.TAG_Byte_Array:
                        Payload[i] = (TAG)new TAG_Byte_Array(data);
                        break;
                    case TYPE.TAG_String:
                        Payload[i] = (TAG)new TAG_String(data);
                        break;
                    case TYPE.TAG_List:
                        Payload[i] = (TAG)new TAG_List(data);
                        break;
                    case TYPE.TAG_Compound:
                        Payload[i] = (TAG)new TAG_Compound(data, this);
                        break;
                    case TYPE.TAG_Int_Array:
                        Payload[i] = (TAG)new TAG_Int_Array(data);
                        break;
                    default:
                        throw new Exception("Unrecognized tag type.");
                }
            }
        }
예제 #4
0
파일: Tag.cs 프로젝트: mblaine/NbtViewer
 public TAG_List(TAG[] payload, Byte tagId)
     : this()
 {
     TagId = new TAG_Byte(tagId);
     Length = new TAG_Int(payload.Length);
     Payload = payload;
 }
예제 #5
0
파일: Tag.cs 프로젝트: mblaine/NbtViewer
 public TAG_List()
 {
     TagId = null;
     Length = null;
     Payload = null;
     Type = TYPE.TAG_List;
 }
예제 #6
0
파일: Tag.cs 프로젝트: mblaine/NbtViewer
 public override void Read(Stream data)
 {
     Payload = new Dictionary<String, TAG>();
     while (true)
     {
         if (data.Position >= data.Length)
             break;
         TAG_Byte tagType = new TAG_Byte(data);
         if (tagType.Payload == (SByte)TYPE.TAG_End)
             break;
         TAG_String name = new TAG_String(data);
         TAG nextTag = null;
         switch ((TYPE)tagType.Payload)
         {
             case TYPE.TAG_Byte:
                 nextTag = (TAG)new TAG_Byte(data);
                 break;
             case TYPE.TAG_Short:
                 nextTag = (TAG)new TAG_Short(data);
                 break;
             case TYPE.TAG_Int:
                 nextTag = (TAG)new TAG_Int(data);
                 break;
             case TYPE.TAG_Long:
                 nextTag = (TAG)new TAG_Long(data);
                 break;
             case TYPE.TAG_Float:
                 nextTag = (TAG)new TAG_Float(data);
                 break;
             case TYPE.TAG_Double:
                 nextTag = (TAG)new TAG_Double(data);
                 break;
             case TYPE.TAG_Byte_Array:
                 nextTag = (TAG)new TAG_Byte_Array(data);
                 break;
             case TYPE.TAG_String:
                 nextTag = (TAG)new TAG_String(data);
                 break;
             case TYPE.TAG_List:
                 nextTag = (TAG)new TAG_List(data);
                 break;
             case TYPE.TAG_Compound:
                 nextTag = (TAG)new TAG_Compound(data, this);
                 break;
             case TYPE.TAG_Int_Array:
                 nextTag = (TAG)new TAG_Int_Array(data);
                 break;
             default:
                 throw new Exception("Unrecognized tag type.");
         }
         nextTag.Name = name;
         nextTag.IsNamed = true;
         Payload.Add(name.PayloadString, nextTag);
     }
 }
예제 #7
0
        public override void Read(Stream data)
        {
            TagId = new TAG_Byte();
            TagId.Read(data);

            Length = new TAG_Int();
            Length.Read(data);

            Payload = new TAG[Length.Payload];
            for (Int32 i = 0; i < Length.Payload; i++)
            {
                switch ((TYPE)TagId.Payload)
                {
                case TYPE.TAG_Byte:
                    Payload[i] = (TAG) new TAG_Byte(data);
                    break;

                case TYPE.TAG_Short:
                    Payload[i] = (TAG) new TAG_Short(data);
                    break;

                case TYPE.TAG_Int:
                    Payload[i] = (TAG) new TAG_Int(data);
                    break;

                case TYPE.TAG_Long:
                    Payload[i] = (TAG) new TAG_Long(data);
                    break;

                case TYPE.TAG_Float:
                    Payload[i] = (TAG) new TAG_Float(data);
                    break;

                case TYPE.TAG_Double:
                    Payload[i] = (TAG) new TAG_Double(data);
                    break;

                case TYPE.TAG_Byte_Array:
                    Payload[i] = (TAG) new TAG_Byte_Array(data);
                    break;

                case TYPE.TAG_String:
                    Payload[i] = (TAG) new TAG_String(data);
                    break;

                case TYPE.TAG_List:
                    Payload[i] = (TAG) new TAG_List(data);
                    break;

                case TYPE.TAG_Compound:
                    Payload[i] = (TAG) new TAG_Compound(data, this);
                    break;

                case TYPE.TAG_Int_Array:
                    Payload[i] = (TAG) new TAG_Int_Array(data);
                    break;

                default:
                    throw new Exception("Unrecognized tag type.");
                }
            }
        }
예제 #8
0
        public override void Read(Stream data)
        {
            Payload = new Dictionary <String, TAG>();
            while (true)
            {
                if (data.Position >= data.Length)
                {
                    break;
                }
                TAG_Byte tagType = new TAG_Byte(data);
                if (tagType.Payload == (SByte)TYPE.TAG_End)
                {
                    break;
                }
                TAG_String name    = new TAG_String(data);
                TAG        nextTag = null;
                switch ((TYPE)tagType.Payload)
                {
                case TYPE.TAG_Byte:
                    nextTag = (TAG) new TAG_Byte(data);
                    break;

                case TYPE.TAG_Short:
                    nextTag = (TAG) new TAG_Short(data);
                    break;

                case TYPE.TAG_Int:
                    nextTag = (TAG) new TAG_Int(data);
                    break;

                case TYPE.TAG_Long:
                    nextTag = (TAG) new TAG_Long(data);
                    break;

                case TYPE.TAG_Float:
                    nextTag = (TAG) new TAG_Float(data);
                    break;

                case TYPE.TAG_Double:
                    nextTag = (TAG) new TAG_Double(data);
                    break;

                case TYPE.TAG_Byte_Array:
                    nextTag = (TAG) new TAG_Byte_Array(data);
                    break;

                case TYPE.TAG_String:
                    nextTag = (TAG) new TAG_String(data);
                    break;

                case TYPE.TAG_List:
                    nextTag = (TAG) new TAG_List(data);
                    break;

                case TYPE.TAG_Compound:
                    nextTag = (TAG) new TAG_Compound(data, this);
                    break;

                case TYPE.TAG_Int_Array:
                    nextTag = (TAG) new TAG_Int_Array(data);
                    break;

                default:
                    throw new Exception("Unrecognized tag type.");
                }
                nextTag.Name    = name;
                nextTag.IsNamed = true;
                Payload.Add(name.PayloadString, nextTag);
            }
        }