From 5de23be1fea87789171ba54e797be863eb9ae928 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Mon, 21 May 2012 21:53:14 -0500 Subject: [PATCH] + * - Changing AxiosTitleFile.GetStream() to return Stream instead of FileStream + * - Changing IAxiosFile.GetStream() to return Stream instead of FileStream --- axios/Axios_settings.cs | 2 ++ axios/Engine/File/AxiosFile.cs | 2 +- axios/Engine/File/AxiosIsolatedFile.cs | 4 ++-- axios/Engine/File/AxiosRegularFile.cs | 4 ++-- axios/Engine/File/AxiosTitleFile.cs | 5 ++--- axios/Engine/Gleed2D/Level.cs | 2 +- axios/Engine/Interfaces/IAxiosFile.cs | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/axios/Axios_settings.cs b/axios/Axios_settings.cs index d76f282..b4f4453 100644 --- a/axios/Axios_settings.cs +++ b/axios/Axios_settings.cs @@ -89,6 +89,8 @@ * - Changing location of GetTexture to extensions * - Enabling commented log messages * - Fixing bug where loadrecentangleitem wouldn't be called by Gleed2D library + * - Changing AxiosTitleFile.GetStream() to return Stream instead of FileStream + * - Changing IAxiosFile.GetStream() to return Stream instead of FileStream * */ #endregion diff --git a/axios/Engine/File/AxiosFile.cs b/axios/Engine/File/AxiosFile.cs index 1014720..4e4eecd 100644 --- a/axios/Engine/File/AxiosFile.cs +++ b/axios/Engine/File/AxiosFile.cs @@ -29,7 +29,7 @@ namespace Axios.Engine.File throw new NotImplementedException(); } - public virtual FileStream GetStream(FileMode mode) + public virtual Stream GetStream(FileMode mode) { throw new NotImplementedException(); } diff --git a/axios/Engine/File/AxiosIsolatedFile.cs b/axios/Engine/File/AxiosIsolatedFile.cs index 08656ba..42dd6d4 100644 --- a/axios/Engine/File/AxiosIsolatedFile.cs +++ b/axios/Engine/File/AxiosIsolatedFile.cs @@ -51,7 +51,7 @@ namespace Axios.Engine.File return ret; } - public override FileStream GetStream(FileMode mode) + public override Stream GetStream(FileMode mode) { #if WINDOWS IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForDomain(); @@ -60,7 +60,7 @@ namespace Axios.Engine.File #endif IsolatedStorageFileStream fs = null; fs = savegameStorage.OpenFile(_filename, mode); - return fs; + return (Stream)fs; } } diff --git a/axios/Engine/File/AxiosRegularFile.cs b/axios/Engine/File/AxiosRegularFile.cs index e044aa3..e241d18 100644 --- a/axios/Engine/File/AxiosRegularFile.cs +++ b/axios/Engine/File/AxiosRegularFile.cs @@ -37,10 +37,10 @@ namespace Axios.Engine.File return ret; } - public override FileStream GetStream(FileMode mode) + public override Stream GetStream(FileMode mode) { FileStream fs = new FileStream(_filename, mode); - return fs; + return (Stream)fs; } } } diff --git a/axios/Engine/File/AxiosTitleFile.cs b/axios/Engine/File/AxiosTitleFile.cs index f6a6824..21918d7 100644 --- a/axios/Engine/File/AxiosTitleFile.cs +++ b/axios/Engine/File/AxiosTitleFile.cs @@ -28,10 +28,9 @@ namespace Axios.Engine.File return this.Content; } - public override FileStream GetStream(FileMode mode) + public override Stream GetStream(FileMode mode) { - FileStream fs = (FileStream)TitleContainer.OpenStream(_filename); - return fs; + return (Stream)TitleContainer.OpenStream(_filename);; } } } diff --git a/axios/Engine/Gleed2D/Level.cs b/axios/Engine/Gleed2D/Level.cs index fcf9cb1..6c42202 100644 --- a/axios/Engine/Gleed2D/Level.cs +++ b/axios/Engine/Gleed2D/Level.cs @@ -74,7 +74,7 @@ namespace Axios.Engine.Gleed2D return level; } - public static Level FromStream(FileStream stream, AxiosGameScreen gameScreen) + public static Level FromStream(Stream stream, AxiosGameScreen gameScreen) { Dictionary cache = new Dictionary(); XmlSerializer serializer = new XmlSerializer(typeof(Level)); diff --git a/axios/Engine/Interfaces/IAxiosFile.cs b/axios/Engine/Interfaces/IAxiosFile.cs index ece7fe8..7743336 100644 --- a/axios/Engine/Interfaces/IAxiosFile.cs +++ b/axios/Engine/Interfaces/IAxiosFile.cs @@ -6,6 +6,6 @@ namespace Axios.Engine.Interfaces { void WriteData(string data, FileMode mode); string ReadData(); - FileStream GetStream(FileMode mode); + Stream GetStream(FileMode mode); } }