mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-22 02:09:31 +00:00
25 lines
733 B
C#
25 lines
733 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using MonoGame.Extended.Particles.Modifiers;
|
|
using MonoGame.Extended.Serialization;
|
|
|
|
namespace MonoGame.Extended.Particles.Serialization
|
|
{
|
|
public class ModifierJsonConverter : BaseTypeJsonConverter<Modifier>
|
|
{
|
|
public ModifierJsonConverter()
|
|
: base(GetSupportedTypes(), "Modifier")
|
|
{
|
|
}
|
|
|
|
private static IEnumerable<TypeInfo> GetSupportedTypes()
|
|
{
|
|
return typeof(Modifier)
|
|
.GetTypeInfo()
|
|
.Assembly
|
|
.DefinedTypes
|
|
.Where(type => typeof(Modifier).GetTypeInfo().IsAssignableFrom(type) && !type.IsAbstract);
|
|
}
|
|
}
|
|
} |