2017-03-07 06:56:08 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
2017-03-07 07:10:33 +08:00
|
|
|
|
using osu.Framework.Logging;
|
2017-03-07 06:56:08 +08:00
|
|
|
|
using osu.Framework.Platform;
|
|
|
|
|
using osu.Game.Database;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps.IO
|
|
|
|
|
{
|
|
|
|
|
public abstract class BeatmapArchiveReader : ArchiveReader
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public static BeatmapArchiveReader GetBeatmapArchiveReader(Storage storage, string path)
|
|
|
|
|
{
|
2017-03-07 07:10:33 +08:00
|
|
|
|
try
|
2017-03-07 06:56:08 +08:00
|
|
|
|
{
|
2017-03-07 07:10:33 +08:00
|
|
|
|
return (BeatmapArchiveReader)GetReader(storage, path);
|
|
|
|
|
}
|
|
|
|
|
catch (InvalidCastException e)
|
|
|
|
|
{
|
|
|
|
|
Logger.Error(e, "A tricky ArchiveReader instance passed the test to be a BeatmapArhiveReader, but it's really not");
|
2017-03-10 04:07:21 +08:00
|
|
|
|
throw;
|
2017-03-07 06:56:08 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Reads the beatmap metadata from this archive.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract BeatmapMetadata ReadMetadata();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a list of beatmap file names.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string[] BeatmapFilenames { get; protected set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The storyboard filename. Null if no storyboard is present.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string StoryboardFilename { get; protected set; }
|
|
|
|
|
}
|
|
|
|
|
}
|