2019-05-17 12:08:06 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Xml;
|
2019-02-01 17:19:20 +00:00
|
|
|
|
using RobloxFiles.DataTypes;
|
2019-01-30 06:36:56 +00:00
|
|
|
|
|
2019-02-01 17:19:20 +00:00
|
|
|
|
namespace RobloxFiles.XmlFormat.PropertyTokens
|
2019-01-30 06:36:56 +00:00
|
|
|
|
{
|
|
|
|
|
public class AxesToken : IXmlPropertyToken
|
|
|
|
|
{
|
|
|
|
|
public string Token => "Axes";
|
2019-05-17 12:08:06 +00:00
|
|
|
|
public bool ReadProperty(Property prop, XmlNode token)
|
2019-01-30 06:36:56 +00:00
|
|
|
|
{
|
2019-05-17 12:08:06 +00:00
|
|
|
|
bool success = XmlPropertyTokens.ReadPropertyGeneric<uint>(prop, PropertyType.Axes, token);
|
2019-01-30 06:36:56 +00:00
|
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
uint value = (uint)prop.Value;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Axes axes = (Axes)value;
|
|
|
|
|
prop.Value = axes;
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
success = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return success;
|
|
|
|
|
}
|
2019-05-17 12:08:06 +00:00
|
|
|
|
|
|
|
|
|
public void WriteProperty(Property prop, XmlDocument doc, XmlNode node)
|
|
|
|
|
{
|
|
|
|
|
XmlElement axes = doc.CreateElement("axes");
|
|
|
|
|
node.AppendChild(axes);
|
|
|
|
|
|
|
|
|
|
int value = (int)prop.Value;
|
|
|
|
|
axes.InnerText = value.ToInvariantString();
|
|
|
|
|
}
|
2019-01-30 06:36:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|