public TAG_Compound(Dictionary <String, TAG> payload, String name) : this(payload) { if (name != null && name.Length > 0) { Name = new TAG_String(name); IsNamed = true; } }
public TAG_List(TAG[] payload, Byte tagId, String name) : this(payload, tagId) { if (name != null && name.Length > 0) { Name = new TAG_String(name); IsNamed = true; } }
public TAG_String(String payloadString, String name) : this(payloadString) { if (name != null && name.Length > 0) { Name = new TAG_String(name); IsNamed = true; } }
public TAG_Int_Array(Int32[] payload, String name) : this(payload) { if (name != null && name.Length > 0) { Name = new TAG_String(name); IsNamed = true; } }
public TAG_Double(Double payload, String name) : this(payload) { if (name != null && name.Length > 0) { Name = new TAG_String(name); IsNamed = true; } }
public TAG_Short(Int16 payload, String name) : this(payload) { if (name != null && name.Length > 0) { Name = new TAG_String(name); IsNamed = true; } }
public TAG_Float(Single payload, String name) : this(payload) { if (name != null && name.Length > 0) { Name = new TAG_String(name); IsNamed = true; } }
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); } }
public TAG_Compound(Dictionary<String, TAG> payload, String name) : this(payload) { if (name != null && name.Length > 0) { Name = new TAG_String(name); IsNamed = true; } }
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); } }