wow, its like resource management!
git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1063 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
29
OpenRa.Core/FileSystem.cs
Normal file
29
OpenRa.Core/FileSystem.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenRa.Core
|
||||
{
|
||||
public static class FileSystem
|
||||
{
|
||||
static List<IMountable> packages = new List<IMountable>();
|
||||
|
||||
public static void Mount(IMountable package)
|
||||
{
|
||||
packages.Add(package);
|
||||
}
|
||||
|
||||
internal static Stream GetItem(string filename)
|
||||
{
|
||||
foreach (IMountable package in packages)
|
||||
{
|
||||
Stream s = package.GetItem(filename);
|
||||
if (s != null)
|
||||
return s;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user