25 lines
612 B
C#
25 lines
612 B
C#
using ln.type;
|
|
using System;
|
|
using System.Linq;
|
|
namespace ln.objects.catalog
|
|
{
|
|
public class ODBGuid : ODBValue
|
|
{
|
|
public ODBGuid()
|
|
: base(0x03, Guid.NewGuid())
|
|
{ }
|
|
public ODBGuid(Guid guid)
|
|
: base(0x03, guid)
|
|
{ }
|
|
|
|
public override byte[] Serialize() => ((Guid)Value).ToByteArray();
|
|
protected override int compare(ODBEntity other) => ((Guid)Value).CompareTo((other as ODBGuid).Value);
|
|
|
|
static ODBGuid()
|
|
{
|
|
RegisterDeserializer(0x03, (b, o, l) => new ODBGuid(new Guid(b.Slice(o, 16))));
|
|
}
|
|
|
|
}
|
|
}
|