Roblox-File-Format/XmlFormat/Tokens/Axes.cs

33 lines
821 B
C#
Raw Normal View History

using System.Xml;
using RobloxFiles.DataTypes;
namespace RobloxFiles.XmlFormat.PropertyTokens
{
public class AxesToken : IXmlPropertyToken
{
public string Token => "Axes";
public bool ReadProperty(Property prop, XmlNode token)
{
2020-08-17 05:33:59 +00:00
if (XmlPropertyTokens.ReadPropertyGeneric(token, out uint value))
{
Axes axes = (Axes)value;
prop.Value = axes;
return true;
}
return false;
}
public void WriteProperty(Property prop, XmlDocument doc, XmlNode node)
{
XmlElement axes = doc.CreateElement("axes");
node.AppendChild(axes);
int value = prop.CastValue<int>();
axes.InnerText = value.ToInvariantString();
}
}
}