1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-15 10:39:09 +01:00
MLEM/MLEM.Data/Content/XmlReader.cs

25 lines
632 B
C#
Raw Normal View History

2020-04-22 00:47:09 +02:00
using System;
using System.IO;
using System.Xml.Serialization;
namespace MLEM.Data.Content {
/// <inheritdoc />
2020-04-22 00:47:09 +02:00
public class XmlReader : RawContentReader {
/// <inheritdoc />
2020-04-22 00:47:09 +02:00
public override bool CanRead(Type t) {
return true;
}
/// <inheritdoc />
2020-04-22 00:47:09 +02:00
public override object Read(RawContentManager manager, string assetPath, Stream stream, Type t, object existing) {
return new XmlSerializer(t).Deserialize(stream);
}
/// <inheritdoc />
2020-04-22 00:47:09 +02:00
public override string[] GetFileExtensions() {
return new[] {"xml"};
}
}
}