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