2021-10-01 05:34:11 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using osu.Framework.Localisation;
|
2021-10-01 07:31:11 +00:00
|
|
|
using osu.Game.Database;
|
|
|
|
using osu.Game.Rulesets;
|
2021-10-01 05:34:11 +00:00
|
|
|
|
|
|
|
#nullable enable
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// A single beatmap difficulty.
|
|
|
|
/// </summary>
|
|
|
|
public interface IBeatmapInfo : IHasOnlineID
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The user-specified name given to this beatmap.
|
|
|
|
/// </summary>
|
|
|
|
string DifficultyName { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The metadata representing this beatmap. May be shared between multiple beatmaps.
|
|
|
|
/// </summary>
|
|
|
|
IBeatmapMetadataInfo Metadata { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The difficulty settings for this beatmap.
|
|
|
|
/// </summary>
|
|
|
|
IBeatmapDifficultyInfo Difficulty { get; }
|
|
|
|
|
2021-10-01 08:22:25 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The beatmap set this beatmap is part of.
|
|
|
|
/// </summary>
|
|
|
|
IBeatmapSetInfo BeatmapSet { get; }
|
|
|
|
|
2021-10-01 05:34:11 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The playable length in milliseconds of this beatmap.
|
|
|
|
/// </summary>
|
|
|
|
double Length { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The most common BPM of this beatmap.
|
|
|
|
/// </summary>
|
|
|
|
double BPM { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The SHA-256 hash representing this beatmap's contents.
|
|
|
|
/// </summary>
|
|
|
|
string Hash { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
2021-10-04 07:55:51 +00:00
|
|
|
/// MD5 is kept for legacy support (matching against replays etc.).
|
2021-10-01 05:34:11 +00:00
|
|
|
/// </summary>
|
|
|
|
string MD5Hash { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The ruleset this beatmap was made for.
|
|
|
|
/// </summary>
|
|
|
|
IRulesetInfo Ruleset { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The basic star rating for this beatmap (with no mods applied).
|
|
|
|
/// </summary>
|
|
|
|
double StarRating { get; }
|
|
|
|
|
2021-10-01 08:33:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// A user-presentable display title representing this metadata.
|
|
|
|
/// </summary>
|
2021-10-01 05:34:11 +00:00
|
|
|
string DisplayTitle => $"{Metadata} {versionString}".Trim();
|
|
|
|
|
2021-10-01 08:33:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// A user-presentable display title representing this beatmap, with localisation handling for potentially romanisable fields.
|
|
|
|
/// </summary>
|
2021-10-01 05:34:11 +00:00
|
|
|
RomanisableString DisplayTitleRomanisable
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
var metadata = Metadata.DisplayTitleRomanisable;
|
|
|
|
|
|
|
|
return new RomanisableString($"{metadata.GetPreferred(true)} {versionString}".Trim(), $"{metadata.GetPreferred(false)} {versionString}".Trim());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private string versionString => string.IsNullOrEmpty(DifficultyName) ? string.Empty : $"[{DifficultyName}]";
|
|
|
|
}
|
|
|
|
}
|