Added MonoGame Pipeline's IntermediateSerializer and needed classes from the pipeline and MonoGame.Framework.Utilities to make AnimationEditor capable of reading Dictionaries
30 lines
964 B
C#
30 lines
964 B
C#
// MonoGame - Copyright (C) The MonoGame Team
|
|
// This file is subject to the terms and conditions defined in
|
|
// file 'LICENSE.txt', which is part of this source code package.
|
|
|
|
using System.Collections.Generic;
|
|
using System.Xml;
|
|
|
|
namespace Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
|
|
{
|
|
[ContentTypeSerializer]
|
|
class Vector2Serializer : ElementSerializer<Vector2>
|
|
{
|
|
public Vector2Serializer() :
|
|
base("Vector2", 2)
|
|
{
|
|
}
|
|
|
|
protected internal override Vector2 Deserialize(string[] inputs, ref int index)
|
|
{
|
|
return new Vector2( XmlConvert.ToSingle(inputs[index++]),
|
|
XmlConvert.ToSingle(inputs[index++]));
|
|
}
|
|
|
|
protected internal override void Serialize(Vector2 value, List<string> results)
|
|
{
|
|
results.Add(XmlConvert.ToString(value.X));
|
|
results.Add(XmlConvert.ToString(value.Y));
|
|
}
|
|
}
|
|
} |