Roblox-File-Format/Tokens/Axes.cs

35 lines
844 B
C#
Raw Permalink Normal View History

using System.Xml;
2021-02-25 20:09:54 +00:00
using RobloxFiles.DataTypes;
2021-02-25 20:09:54 +00:00
using RobloxFiles.XmlFormat;
2021-02-25 20:09:54 +00:00
namespace RobloxFiles.Tokens
{
public class AxesToken : IXmlPropertyToken
{
2021-02-25 20:09:54 +00:00
public string XmlPropertyToken => "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();
}
}
}