2020-05-21 17:39:22 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using System;
|
2021-07-21 14:35:59 +08:00
|
|
|
using System.Linq;
|
2020-05-21 17:39:22 +08:00
|
|
|
using osu.Game.Rulesets;
|
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
using osu.Game.Tests.Beatmaps;
|
|
|
|
using osu.Game.Users;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests
|
|
|
|
{
|
|
|
|
public class TestScoreInfo : ScoreInfo
|
|
|
|
{
|
2021-07-21 14:35:59 +08:00
|
|
|
public TestScoreInfo(RulesetInfo ruleset, bool excessMods = false)
|
2020-05-21 17:39:22 +08:00
|
|
|
{
|
|
|
|
User = new User
|
|
|
|
{
|
|
|
|
Id = 2,
|
|
|
|
Username = "peppy",
|
|
|
|
CoverUrl = "https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
|
|
|
|
};
|
|
|
|
|
|
|
|
Beatmap = new TestBeatmap(ruleset).BeatmapInfo;
|
2020-05-21 17:43:12 +08:00
|
|
|
Ruleset = ruleset;
|
|
|
|
RulesetID = ruleset.ID ?? 0;
|
2021-07-21 14:35:59 +08:00
|
|
|
|
|
|
|
Mods = excessMods
|
2021-09-10 10:09:13 +08:00
|
|
|
? ruleset.CreateInstance().CreateAllMods().ToArray()
|
2021-07-21 14:35:59 +08:00
|
|
|
: new Mod[] { new TestModHardRock(), new TestModDoubleTime() };
|
2020-05-21 17:39:22 +08:00
|
|
|
|
|
|
|
TotalScore = 2845370;
|
|
|
|
Accuracy = 0.95;
|
|
|
|
MaxCombo = 999;
|
|
|
|
Rank = ScoreRank.S;
|
|
|
|
Date = DateTimeOffset.Now;
|
|
|
|
|
|
|
|
Statistics[HitResult.Miss] = 1;
|
|
|
|
Statistics[HitResult.Meh] = 50;
|
2020-09-29 16:16:55 +08:00
|
|
|
Statistics[HitResult.Ok] = 100;
|
|
|
|
Statistics[HitResult.Good] = 200;
|
2020-05-21 17:39:22 +08:00
|
|
|
Statistics[HitResult.Great] = 300;
|
2020-09-29 16:16:55 +08:00
|
|
|
Statistics[HitResult.Perfect] = 320;
|
2020-09-25 19:22:59 +08:00
|
|
|
Statistics[HitResult.SmallTickHit] = 50;
|
|
|
|
Statistics[HitResult.SmallTickMiss] = 25;
|
|
|
|
Statistics[HitResult.LargeTickHit] = 100;
|
|
|
|
Statistics[HitResult.LargeTickMiss] = 50;
|
|
|
|
Statistics[HitResult.SmallBonus] = 10;
|
|
|
|
Statistics[HitResult.SmallBonus] = 50;
|
2020-07-28 21:08:10 +08:00
|
|
|
|
|
|
|
Position = 1;
|
2020-05-21 17:39:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private class TestModHardRock : ModHardRock
|
|
|
|
{
|
|
|
|
public override double ScoreMultiplier => 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
private class TestModDoubleTime : ModDoubleTime
|
|
|
|
{
|
|
|
|
public override double ScoreMultiplier => 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|