mirror of
https://github.com/ppy/osu
synced 2025-02-19 03:47:01 +00:00
Move BPM out of OnlineInfo
This commit is contained in:
parent
6ee10640e3
commit
3ea9629daf
@ -96,11 +96,11 @@ namespace osu.Game.Tests.Visual.Online
|
||||
FavouriteCount = 456,
|
||||
Submitted = DateTime.Now,
|
||||
Ranked = DateTime.Now,
|
||||
BPM = 111,
|
||||
HasVideo = true,
|
||||
HasStoryboard = true,
|
||||
Covers = new BeatmapSetOnlineCovers(),
|
||||
},
|
||||
BPM = 111,
|
||||
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() },
|
||||
Beatmaps = new List<BeatmapInfo>
|
||||
{
|
||||
@ -169,11 +169,11 @@ namespace osu.Game.Tests.Visual.Online
|
||||
FavouriteCount = 456,
|
||||
Submitted = DateTime.Now,
|
||||
Ranked = DateTime.Now,
|
||||
BPM = 111,
|
||||
HasVideo = true,
|
||||
HasStoryboard = true,
|
||||
Covers = new BeatmapSetOnlineCovers(),
|
||||
},
|
||||
BPM = 111,
|
||||
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() },
|
||||
Beatmaps = new List<BeatmapInfo>
|
||||
{
|
||||
|
@ -47,11 +47,11 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Preview = @"https://b.ppy.sh/preview/12345.mp3",
|
||||
PlayCount = 123,
|
||||
FavouriteCount = 456,
|
||||
BPM = 111,
|
||||
HasVideo = true,
|
||||
HasStoryboard = true,
|
||||
Covers = new BeatmapSetOnlineCovers(),
|
||||
},
|
||||
BPM = 111,
|
||||
Beatmaps = new List<BeatmapInfo>
|
||||
{
|
||||
new BeatmapInfo
|
||||
|
@ -300,10 +300,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
},
|
||||
Beatmaps = beatmaps,
|
||||
DateAdded = DateTimeOffset.UtcNow,
|
||||
OnlineInfo = new BeatmapSetOnlineInfo
|
||||
{
|
||||
BPM = bpm,
|
||||
}
|
||||
BPM = bpm,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ namespace osu.Game.Tournament.Components
|
||||
return;
|
||||
}
|
||||
|
||||
var bpm = beatmap.BeatmapSet.OnlineInfo.BPM;
|
||||
var bpm = beatmap.BeatmapSet.BPM;
|
||||
var length = beatmap.OnlineInfo.Length;
|
||||
string hardRockExtra = "";
|
||||
string srExtra = "";
|
||||
|
@ -272,10 +272,7 @@ namespace osu.Game.Beatmaps
|
||||
Beatmaps = new List<BeatmapInfo>(),
|
||||
Metadata = beatmap.Metadata,
|
||||
DateAdded = DateTimeOffset.UtcNow,
|
||||
OnlineInfo = new BeatmapSetOnlineInfo
|
||||
{
|
||||
BPM = beatmap.ControlPointInfo.BPMMode,
|
||||
}
|
||||
BPM = beatmap.ControlPointInfo.BPMMode,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,11 @@ namespace osu.Game.Beatmaps
|
||||
[NotMapped]
|
||||
public BeatmapSetMetrics Metrics { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The beats per minute of this beatmap set's song.
|
||||
/// </summary>
|
||||
public double BPM { get; set; }
|
||||
|
||||
public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarDifficulty) ?? 0;
|
||||
|
||||
public double MaxLength => Beatmaps?.Max(b => b.OnlineInfo.Length) ?? 0;
|
||||
|
@ -51,11 +51,6 @@ namespace osu.Game.Beatmaps
|
||||
/// </summary>
|
||||
public string Preview { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The beats per minute of this beatmap set's song.
|
||||
/// </summary>
|
||||
public double BPM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The amount of plays this beatmap set has.
|
||||
/// </summary>
|
||||
|
@ -77,13 +77,13 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
Metadata = this,
|
||||
Status = Status,
|
||||
Metrics = ratings == null ? null : new BeatmapSetMetrics { Ratings = ratings },
|
||||
BPM = bpm,
|
||||
OnlineInfo = new BeatmapSetOnlineInfo
|
||||
{
|
||||
Covers = covers,
|
||||
Preview = preview,
|
||||
PlayCount = playCount,
|
||||
FavouriteCount = favouriteCount,
|
||||
BPM = bpm,
|
||||
Status = Status,
|
||||
HasVideo = hasVideo,
|
||||
HasStoryboard = hasStoryboard,
|
||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
|
||||
private void updateDisplay()
|
||||
{
|
||||
bpm.Value = BeatmapSet?.OnlineInfo?.BPM.ToString(@"0.##") ?? "-";
|
||||
bpm.Value = BeatmapSet?.BPM.ToString(@"0.##") ?? "-";
|
||||
|
||||
if (beatmap == null)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
return otherSet.BeatmapSet.DateAdded.CompareTo(BeatmapSet.DateAdded);
|
||||
|
||||
case SortMode.BPM:
|
||||
return BeatmapSet.OnlineInfo.BPM.CompareTo(otherSet.BeatmapSet.OnlineInfo.BPM);
|
||||
return BeatmapSet.BPM.CompareTo(otherSet.BeatmapSet.BPM);
|
||||
|
||||
case SortMode.Length:
|
||||
return BeatmapSet.MaxLength.CompareTo(otherSet.BeatmapSet.MaxLength);
|
||||
|
Loading…
Reference in New Issue
Block a user