forked from jaquadro/NBTExplorer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
TagKey.cs
39 lines (30 loc) · 852 Bytes
/
TagKey.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using Substrate.Nbt;
namespace NBTExplorer
{
public class TagKey : IComparable<TagKey>
{
public TagKey(string name, TagType type)
{
Name = name;
TagType = type;
}
public string Name { get; set; }
public TagType TagType { get; set; }
#region IComparer<TagKey> 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<TagKey> Members
public int CompareTo(TagKey other)
{
return Compare(this, other);
}
#endregion
}
}