using System; using Substrate.Nbt; namespace NBTExplorer { public class TagKey : IComparable { public TagKey (string name, TagType type) { Name = name; TagType = type; } public string Name { get; set; } public TagType TagType { get; set; } #region IComparer Members public int Compare (TagKey x, TagKey y) { int typeDiff = (int)x.TagType - (int)y.TagType; if (typeDiff != 0) return typeDiff; return String.Compare(x.Name, y.Name, true); } #endregion #region IComparable Members public int CompareTo (TagKey other) { return Compare(this, other); } #endregion } }