// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Localisation; #nullable enable namespace osu.Game.Beatmaps { /// /// A single beatmap difficulty. /// public interface IBeatmapInfo : IHasOnlineID { /// /// The user-specified name given to this beatmap. /// string DifficultyName { get; } /// /// The metadata representing this beatmap. May be shared between multiple beatmaps. /// IBeatmapMetadataInfo Metadata { get; } /// /// The difficulty settings for this beatmap. /// IBeatmapDifficultyInfo Difficulty { get; } /// /// The playable length in milliseconds of this beatmap. /// double Length { get; } /// /// The most common BPM of this beatmap. /// double BPM { get; } /// /// The SHA-256 hash representing this beatmap's contents. /// string Hash { get; } /// /// MD5 is kept for legacy support (matching against replays, osu-web-10 etc.). /// string MD5Hash { get; } /// /// The ruleset this beatmap was made for. /// IRulesetInfo Ruleset { get; } /// /// The basic star rating for this beatmap (with no mods applied). /// double StarRating { get; } string DisplayTitle => $"{Metadata} {versionString}".Trim(); 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}]"; } }