0.513.0.5130420 + UniqueId

Caught up with latest API changes and implemented UniqueId.
This commit is contained in:
Max
2022-02-10 15:22:44 -06:00
parent c4f0953858
commit 034799a4de
9 changed files with 856 additions and 258 deletions

29
Tokens/UniqueId.cs Normal file
View File

@ -0,0 +1,29 @@
using System;
using System.Xml;
namespace RobloxFiles.Tokens
{
public class UniqueId : IXmlPropertyToken
{
public string XmlPropertyToken => "UniqueId";
public bool ReadProperty(Property prop, XmlNode token)
{
string hex = token.InnerText;
if (Guid.TryParse(hex, out var guid))
{
prop.Value = guid;
return true;
}
return false;
}
public void WriteProperty(Property prop, XmlDocument doc, XmlNode node)
{
var guid = prop.CastValue<Guid>();
node.InnerText = guid.ToString("N");
}
}
}