1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 14:42:56 +08:00

Metric -> Metrics.

This commit is contained in:
Dean Herbert 2017-04-12 21:09:39 +09:00
parent 00cd2c8372
commit 2c3fa30386
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
5 changed files with 14 additions and 11 deletions

View File

@ -40,7 +40,7 @@ namespace osu.Desktop.VisualTests.Tests
DrainRate = 1,
},
StarDifficulty = 5.3f,
Metric = new BeatmapMetric
Metrics = new BeatmapMetrics
{
Ratings = Enumerable.Range(0,10),
Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6),
@ -56,8 +56,8 @@ namespace osu.Desktop.VisualTests.Tests
private void newRetryAndFailValues()
{
details.Beatmap.Metric.Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6);
details.Beatmap.Metric.Retries = Enumerable.Range(lastRange - 3, 100).Select(i => i % 12 - 6);
details.Beatmap.Metrics.Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6);
details.Beatmap.Metrics.Retries = Enumerable.Range(lastRange - 3, 100).Select(i => i % 12 - 6);
details.Beatmap = details.Beatmap;
lastRange += 100;
}

View File

@ -42,7 +42,7 @@ namespace osu.Game.Database
public BeatmapDifficulty Difficulty { get; set; }
[Ignore]
public BeatmapMetric Metric { get; set; }
public BeatmapMetrics Metrics { get; set; }
public string Path { get; set; }

View File

@ -5,7 +5,10 @@ using System.Collections.Generic;
namespace osu.Game.Database
{
public class BeatmapMetric
/// <summary>
/// Beatmap metrics based on acculumated online data from community plays.
/// </summary>
public class BeatmapMetrics
{
/// <summary>
/// Total vote counts of user ratings on a scale of 0..length.

View File

@ -61,9 +61,9 @@ namespace osu.Game.Screens.Select
approachRate.Value = beatmap.Difficulty.ApproachRate;
stars.Value = (float)beatmap.StarDifficulty;
if (beatmap.Metric?.Ratings.Any() ?? false)
if (beatmap.Metrics?.Ratings.Any() ?? false)
{
var ratings = beatmap.Metric.Ratings.ToList();
var ratings = beatmap.Metrics.Ratings.ToList();
ratingsContainer.Show();
negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2).Sum().ToString();
@ -75,10 +75,10 @@ namespace osu.Game.Screens.Select
else
ratingsContainer.Hide();
if ((beatmap.Metric?.Retries.Any() ?? false) && beatmap.Metric.Fails.Any())
if ((beatmap.Metrics?.Retries.Any() ?? false) && beatmap.Metrics.Fails.Any())
{
var retries = beatmap.Metric.Retries;
var fails = beatmap.Metric.Fails;
var retries = beatmap.Metrics.Retries;
var fails = beatmap.Metrics.Fails;
retryFailContainer.Show();
float maxValue = fails.Zip(retries, (fail, retry) => fail + retry).Max();

View File

@ -76,7 +76,7 @@
<Compile Include="Beatmaps\Legacy\LegacyBeatmap.cs" />
<Compile Include="Beatmaps\Timing\TimeSignatures.cs" />
<Compile Include="Beatmaps\Timing\TimingInfo.cs" />
<Compile Include="Database\BeatmapMetric.cs" />
<Compile Include="Database\BeatmapMetrics.cs" />
<Compile Include="Database\ScoreDatabase.cs" />
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
<Compile Include="Graphics\Cursor\CursorTrail.cs" />