mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-06-28 15:29:10 +02:00
28 lines
816 B
C#
28 lines
816 B
C#
|
using System;
|
||
|
using System.IO;
|
||
|
|
||
|
namespace MLEM.Content {
|
||
|
public abstract class RawContentReader {
|
||
|
|
||
|
public abstract bool CanRead(Type t);
|
||
|
|
||
|
public abstract object Read(RawContentManager manager, string assetPath, Stream stream, object existing);
|
||
|
|
||
|
public abstract string[] GetFileExtensions();
|
||
|
|
||
|
}
|
||
|
|
||
|
public abstract class RawContentReader<T> : RawContentReader {
|
||
|
|
||
|
public override bool CanRead(Type t) {
|
||
|
return typeof(T).IsAssignableFrom(t);
|
||
|
}
|
||
|
|
||
|
public override object Read(RawContentManager manager, string assetPath, Stream stream, object existing) {
|
||
|
return this.Read(manager, assetPath, stream, (T) existing);
|
||
|
}
|
||
|
|
||
|
protected abstract T Read(RawContentManager manager, string assetPath, Stream stream, T existing);
|
||
|
|
||
|
}
|
||
|
}
|