From c84a9d56f5051aca638bcd57b956d2a470da5b16 Mon Sep 17 00:00:00 2001 From: Alex Amadori Date: Mon, 13 Mar 2017 11:36:21 +0100 Subject: [PATCH] Fix namespace, comply with naming rules --- osu.Desktop/OsuGameDesktop.cs | 4 ++-- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 2 +- osu.Game/Beatmaps/IO/BeatmapArchiveReader.cs | 3 ++- osu.Game/Beatmaps/IO/OszArchiveReader.cs | 2 +- osu.Game/Database/BeatmapDatabase.cs | 2 +- osu.Game/IO/ArchiveReader.cs | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index a05925654d..a09f9860cb 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -58,7 +58,7 @@ namespace osu.Desktop var dropData = (object[])e.Data.GetData(DataFormats.FileDrop); var filePaths = dropData.Select(f => f.ToString()).ToArray(); - if (filePaths.All(f => Path.GetExtension(f) == BeatmapArchiveReader.OszExtension)) + if (filePaths.All(f => Path.GetExtension(f) == BeatmapArchiveReader.OSZ_EXTENSION)) Task.Run(() => BeatmapDatabase.Import(filePaths)); else if (filePaths.All(f => Path.GetExtension(f) == @".osr")) Task.Run(() => @@ -68,7 +68,7 @@ namespace osu.Desktop }); } - private static readonly string[] allowed_extensions = { BeatmapArchiveReader.OszExtension, @".osr" }; + private static readonly string[] allowed_extensions = { BeatmapArchiveReader.OSZ_EXTENSION, @".osr" }; private void dragEnter(DragEventArgs e) { diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 5239286b56..a6ab6a989b 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -107,7 +107,7 @@ namespace osu.Game.Tests.Beatmaps.IO private string prepareTempCopy(string path) { - var temp = Path.GetTempPath() + Guid.NewGuid() + BeatmapArchiveReader.OszExtension; + var temp = Path.GetTempPath() + Guid.NewGuid() + BeatmapArchiveReader.OSZ_EXTENSION; return new FileInfo(path).CopyTo(temp, true).FullName; } diff --git a/osu.Game/Beatmaps/IO/BeatmapArchiveReader.cs b/osu.Game/Beatmaps/IO/BeatmapArchiveReader.cs index d274d45694..0fab05df49 100644 --- a/osu.Game/Beatmaps/IO/BeatmapArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/BeatmapArchiveReader.cs @@ -5,12 +5,13 @@ using System; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Database; +using osu.Game.IO; namespace osu.Game.Beatmaps.IO { public abstract class BeatmapArchiveReader : ArchiveReader { - public const string OszExtension = @".osz"; + public const string OSZ_EXTENSION = @".osz"; public static BeatmapArchiveReader GetBeatmapArchiveReader(Storage storage, string path) { diff --git a/osu.Game/Beatmaps/IO/OszArchiveReader.cs b/osu.Game/Beatmaps/IO/OszArchiveReader.cs index 60d379db61..8c3e4d702c 100644 --- a/osu.Game/Beatmaps/IO/OszArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/OszArchiveReader.cs @@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.IO AddReader((storage, path) => { using (var stream = storage.GetStream(path)) - return Path.GetExtension(path) == OszExtension && ZipFile.IsZipFile(stream, false); + return Path.GetExtension(path) == OSZ_EXTENSION && ZipFile.IsZipFile(stream, false); }); OsuLegacyDecoder.Register(); } diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index c7b02acae1..a9fe30a5e9 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -186,7 +186,7 @@ namespace osu.Game.Database { hash = input.GetMd5Hash(); input.Seek(0, SeekOrigin.Begin); - path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash + BeatmapArchiveReader.OszExtension); + path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash + BeatmapArchiveReader.OSZ_EXTENSION); if (!storage.Exists(path)) using (var output = storage.GetStream(path, FileAccess.Write)) input.CopyTo(output); diff --git a/osu.Game/IO/ArchiveReader.cs b/osu.Game/IO/ArchiveReader.cs index ba84402782..8eaecdeabc 100644 --- a/osu.Game/IO/ArchiveReader.cs +++ b/osu.Game/IO/ArchiveReader.cs @@ -7,7 +7,7 @@ using System.IO; using osu.Framework.IO.Stores; using osu.Framework.Platform; -namespace osu.Game.Beatmaps.IO +namespace osu.Game.IO { public abstract class ArchiveReader : IDisposable, IResourceStore {