Implement mod-defined package loaders.

This commit is contained in:
Paul Chote
2017-05-07 12:25:04 +00:00
parent 9b4f602cca
commit 0222ea675c
26 changed files with 993 additions and 838 deletions

View File

@@ -15,12 +15,23 @@ using System.IO;
namespace OpenRA.FileSystem
{
public interface IPackageLoader
{
/// <summary>
/// Attempt to parse a stream as this type of package.
/// If successful, the loader is expected to take ownership of `s` and dispose it once done.
/// If unsuccessful, the loader is expected to return the stream position to where it started.
/// </summary>
bool TryParsePackage(Stream s, string filename, FileSystem context, out IReadOnlyPackage package);
}
public interface IReadOnlyPackage : IDisposable
{
string Name { get; }
IEnumerable<string> Contents { get; }
Stream GetStream(string filename);
bool Contains(string filename);
IReadOnlyPackage OpenPackage(string filename, FileSystem context);
}
public interface IReadWritePackage : IReadOnlyPackage