2020-04-22 00:47:09 +02:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
2020-09-16 23:39:01 +02:00
|
|
|
namespace MLEM.Data.Content {
|
2020-05-21 12:53:42 +02:00
|
|
|
/// <inheritdoc />
|
2020-04-22 00:47:09 +02:00
|
|
|
public class XmlReader : RawContentReader {
|
|
|
|
|
2020-05-21 12:53:42 +02:00
|
|
|
/// <inheritdoc />
|
2020-04-22 00:47:09 +02:00
|
|
|
public override bool CanRead(Type t) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-05-21 12:53:42 +02:00
|
|
|
/// <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);
|
|
|
|
}
|
|
|
|
|
2020-05-21 12:53:42 +02:00
|
|
|
/// <inheritdoc />
|
2020-04-22 00:47:09 +02:00
|
|
|
public override string[] GetFileExtensions() {
|
|
|
|
return new[] {"xml"};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2022-06-17 18:23:47 +02:00
|
|
|
}
|