Add a BPM property in BeatmapInfo

This commit is contained in:
iiSaLMaN
2019-07-08 10:43:35 +03:00
parent 2d0c924bdf
commit 129899f419
6 changed files with 19 additions and 14 deletions

View File

@ -267,15 +267,18 @@ namespace osu.Game.Tests.Visual.SongSelect
for (int i = 0; i < 6; i++)
{
int beatmapId = setId * 10 + i;
int length = RNG.Next(30000, 200000);
double bpm = RNG.NextSingle(80, 200);
beatmaps.Add(new BeatmapInfo
{
Ruleset = getRuleset(),
OnlineBeatmapID = beatmapId,
Path = "normal.osu",
Version = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss})",
Version = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})",
Length = length,
BPM = bpm,
BaseDifficulty = new BeatmapDifficulty
{
OverallDifficulty = 3.5f,
@ -283,7 +286,6 @@ namespace osu.Game.Tests.Visual.SongSelect
});
}
double bpm = RNG.NextSingle(80, 200);
return new BeatmapSetInfo
{
OnlineBeatmapSetID = setId,
@ -292,15 +294,11 @@ namespace osu.Game.Tests.Visual.SongSelect
{
// Create random metadata, then we can check if sorting works based on these
Artist = "Some Artist " + RNG.Next(0, 9),
Title = $"Some Song (set id {setId}, bpm {bpm:0.#})",
Title = $"Some Song (set id {setId}, max bpm {beatmaps.Max(b => b.BPM):0.#})",
AuthorString = "Some Guy " + RNG.Next(0, 9),
},
Beatmaps = beatmaps,
DateAdded = DateTimeOffset.UtcNow,
OnlineInfo = new BeatmapSetOnlineInfo
{
BPM = bpm,
}
};
}
}