1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:47:24 +08:00

Fix namespace, comply with naming rules

This commit is contained in:
Alex Amadori 2017-03-13 11:36:21 +01:00
parent caa6e9c82b
commit c84a9d56f5
6 changed files with 8 additions and 7 deletions

View File

@ -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)
{

View File

@ -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;
}

View File

@ -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)
{

View File

@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.IO
AddReader<OszArchiveReader>((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();
}

View File

@ -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);

View File

@ -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<byte[]>
{