mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
21 lines
514 B
C#
21 lines
514 B
C#
using AssetRipper.IO.Files.Streams.Smart;
|
|
|
|
namespace AssetRipper.IO.Files
|
|
{
|
|
public abstract class Scheme<T> : IScheme where T : FileBase, new()
|
|
{
|
|
public abstract bool CanRead(SmartStream stream);
|
|
|
|
public T Read(SmartStream stream, string filePath, string fileName)
|
|
{
|
|
T file = new();
|
|
file.FilePath = filePath;
|
|
file.Name = fileName;
|
|
file.Read(stream);
|
|
return file;
|
|
}
|
|
|
|
FileBase IScheme.Read(SmartStream stream, string filePath, string fileName) => Read(stream, filePath, fileName);
|
|
}
|
|
}
|