Unstatic GlobalFileSystem and rename it to FileSystem

Add a ModFiles field on ModData and move all access to the file system to go through that.
This commit is contained in:
Pavel Penev
2015-10-09 13:55:08 +03:00
parent 5684bcec1c
commit 1b88d24cfa
46 changed files with 154 additions and 172 deletions

View File

@@ -9,7 +9,6 @@
#endregion
using OpenRA.FileFormats;
using OpenRA.FileSystem;
namespace OpenRA.GameRules
{
@@ -36,11 +35,11 @@ namespace OpenRA.GameRules
public void Load()
{
if (!GlobalFileSystem.Exists(Filename))
if (!Game.ModData.ModFiles.Exists(Filename))
return;
Exists = true;
using (var s = GlobalFileSystem.Open(Filename))
using (var s = Game.ModData.ModFiles.Open(Filename))
{
if (Filename.ToLowerInvariant().EndsWith("wav"))
Length = (int)WavLoader.WaveLength(s);