2017-04-18 21:35:21 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
2017-04-20 10:02:56 +08:00
|
|
|
|
using System.Collections.Generic;
|
2017-04-11 13:01:13 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Game.Beatmaps;
|
2017-04-18 14:16:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2017-04-11 13:01:13 +08:00
|
|
|
|
using osu.Game.Screens.Ranking;
|
|
|
|
|
using osu.Game.Users;
|
|
|
|
|
|
2017-08-04 14:37:31 +08:00
|
|
|
|
namespace osu.Desktop.Tests.Visual
|
2017-04-11 13:01:13 +08:00
|
|
|
|
{
|
2017-08-04 14:37:31 +08:00
|
|
|
|
internal class TestCaseResults : OsuTestCase
|
2017-04-11 13:01:13 +08:00
|
|
|
|
{
|
2017-07-27 15:56:41 +08:00
|
|
|
|
private BeatmapManager beatmaps;
|
2017-04-11 13:01:13 +08:00
|
|
|
|
|
|
|
|
|
public override string Description => @"Results after playing.";
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2017-07-27 15:56:41 +08:00
|
|
|
|
private void load(BeatmapManager beatmaps)
|
2017-04-11 13:01:13 +08:00
|
|
|
|
{
|
2017-07-27 14:34:13 +08:00
|
|
|
|
this.beatmaps = beatmaps;
|
2017-04-11 13:01:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private WorkingBeatmap beatmap;
|
|
|
|
|
|
2017-07-07 20:05:55 +08:00
|
|
|
|
protected override void LoadComplete()
|
2017-04-11 13:01:13 +08:00
|
|
|
|
{
|
2017-07-07 20:05:55 +08:00
|
|
|
|
base.LoadComplete();
|
2017-04-11 13:01:13 +08:00
|
|
|
|
|
|
|
|
|
if (beatmap == null)
|
|
|
|
|
{
|
2017-07-27 14:34:13 +08:00
|
|
|
|
var beatmapInfo = beatmaps.QueryBeatmap(b => b.RulesetID == 0);
|
2017-04-11 13:01:13 +08:00
|
|
|
|
if (beatmapInfo != null)
|
2017-07-27 14:34:13 +08:00
|
|
|
|
beatmap = beatmaps.GetWorkingBeatmap(beatmapInfo);
|
2017-04-11 13:01:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-04-20 10:02:56 +08:00
|
|
|
|
Add(new Results(new Score
|
2017-04-11 13:01:13 +08:00
|
|
|
|
{
|
|
|
|
|
TotalScore = 2845370,
|
|
|
|
|
Accuracy = 0.98,
|
2017-04-18 20:35:41 +08:00
|
|
|
|
MaxCombo = 123,
|
2017-04-11 13:01:13 +08:00
|
|
|
|
Rank = ScoreRank.A,
|
2017-05-16 21:14:50 +08:00
|
|
|
|
Date = DateTimeOffset.Now,
|
2017-07-13 14:02:45 +08:00
|
|
|
|
Statistics = new Dictionary<string, dynamic>
|
2017-04-20 10:02:56 +08:00
|
|
|
|
{
|
|
|
|
|
{ "300", 50 },
|
|
|
|
|
{ "100", 20 },
|
|
|
|
|
{ "50", 50 },
|
|
|
|
|
{ "x", 1 }
|
|
|
|
|
},
|
2017-04-11 13:01:13 +08:00
|
|
|
|
User = new User
|
|
|
|
|
{
|
|
|
|
|
Username = "peppy",
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
{
|
2017-07-19 12:32:16 +08:00
|
|
|
|
InitialBeatmap = beatmap
|
2017-04-11 13:01:13 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-20 10:02:56 +08:00
|
|
|
|
}
|