Files
MonoGame.Extended/Source/MonoGame.Extended.Particles/Serialization/InterpolatorJsonConverter.cs
T
Dylan WilsonandGitHub 799b1edb06 Particles data driven (#388)
* yay, a start on data driven particles

* added data driven support for all particle profiles

* pretty much finished all of the particle serialization code

* resolved an inconsistency with the interpolators
2017-05-09 23:48:29 +10:00

25 lines
775 B
C#

using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MonoGame.Extended.Particles.Modifiers.Interpolators;
using MonoGame.Extended.Serialization;
namespace MonoGame.Extended.Particles.Serialization
{
public class InterpolatorJsonConverter : BaseTypeJsonConverter<IInterpolator>
{
public InterpolatorJsonConverter()
: base(GetSupportedTypes(), "Interpolator")
{
}
private static IEnumerable<TypeInfo> GetSupportedTypes()
{
return typeof(IInterpolator)
.GetTypeInfo()
.Assembly
.DefinedTypes
.Where(type => typeof(IInterpolator).GetTypeInfo().IsAssignableFrom(type) && !type.IsAbstract);
}
}
}