namespace Nbt.Tag; public interface INbtTag : IEquatable { NbtTagType Type { get; } INbtTag this[string tagName] { get => throw new NotSupportedException(); set => throw new NotSupportedException(); } INbtTag this[int tagIndex] { get => throw new NotSupportedException(); set => throw new NotSupportedException(); } INbtTag this[INbtPathElement tagPath] { get => throw new NotSupportedException(); set => throw new NotSupportedException(); } INbtTag this[INbtPath tagPath] { get { var count = tagPath.Count; if (count == 0) { return this; } var pathElt = tagPath.PopFirst(out var pathRest); var childTag = this[pathElt]; return childTag[pathRest]; } set { var count = tagPath.Count; if (count == 0) { throw new ArgumentException("Path cannot be empty", nameof(value)); } var pathElt = tagPath.PopFirst(out var pathRest); if (count == 1) { this[pathElt] = value; } else { var childTag = this[pathElt]; childTag[pathRest] = value; } } } INbtList AsList() => (INbtList)this; INbtCompound AsCompound() => (INbtCompound)this; INbtValue AsValue() => (INbtValue)this; INbtValue AsValue() where T : notnull => (INbtValue)this; INbtArray AsArray() => (INbtArray)this; INbtArray AsArray() where T : notnull => (INbtArray)this; T As() where T : INbtTag => (T)this; INbtTag Copy(); }